How to give a meaningful name to the model property and still map with the database table field?
To do this, we can use
Column
attribute in the Model property. [Column("Active")] [Display(Name = "Is Active?")] public bool IsActive { get; set; }
Here, the model property name is the
IsActive
however we are mapping this property to the Active
field of the database table.
No comments:
Post a Comment