Representation of an entity in my class

5

I have this field in the database: ID_LIBERACAO and in my domain class I have this:

[Table("Tabela")]
public class Tabela
[Key]
[DataBaseGenerated(DataBaseGeneratedOption.Identity)]
public int IdLiberacao {get; set; }

Even with the name without the underscore, does my class mean you are referring to the table field? I deleted all underscore from field names and standardized this way. I have no way to test it until I get the client release.

    
asked by anonymous 20.08.2017 / 21:33

1 answer

2

Specify the name that is in the database, use annotation , see:

[Table("Tabela")]
public class Tabela
[Key]
[DataBaseGenerated(DataBaseGeneratedOption.Identity)]
[Column("ID_LIBERACAO")]
public int IdLiberacao {get; set; }

Reference: DataAnnotation

    
20.08.2017 / 21:47