EntityFramework SqlQuery does not work with custom mapping (DataAnnotation Column)
问题 I'm using EF 5.0 (CodeFirst) with VS 2012 and am having trouble making a query using SqlQuery. The problem happens in the mapping between the property name of the entity and the name of the column in the database. My entity (model): [Table("Teste")] public class TesteEntity { [Column("Teste_Id")] public int Id { get; set; } [Required] public bool IsAdministrator { get; set; } [Required] public string Name { get; set; } } When I run the query, I get an error. Rotine: List<TesteEntity> list =