In all my models I have table names and columns not matching to the class names and properties. For example it generated this class:
public partial class SettingsItem
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
public long ID { get; set; }
[MaxLength(50)]
[Required]
public string Name { get; set; }
[MaxLength(2147483647)]
public byte[] Value { get; set; }
public DateTime Created { get; set; }
public DateTime? Updated { get; set; }
}
but in my case it won't work. I need it to be this
[Table("t_settings")]
public partial class SettingsItem
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
[Column("fID")]
public long ID { get; set; }
[MaxLength(50)]
[Required]
[Column("fName")]
public string Name { get; set; }
[MaxLength(2147483647)]
[Column("fValue")]
public byte[] Value { get; set; }
[Column("fCreated")]
public DateTime Created { get; set; }
[Column("fUpdated")]
public DateTime? Updated { get; set; }
}
All that is part of the EDMX mapping information, of course.
In all my models I have table names and columns not matching to the class names and properties. For example it generated this class:
but in my case it won't work. I need it to be this
[Table("t_settings")]
public partial class SettingsItem
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
[Column("fID")]
public long ID { get; set; }
All that is part of the EDMX mapping information, of course.