I am adding to an entity a property called DateCreated
, which will be set programmatically.
I want the update-database
process to create a table column for it, as it does for all other properties. But I do not want it to create a date picker for it in the corresponding create view.
I believe the NotMapped
attribute will exclude the property from the DB table completely
Example:
public class Person
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
//dont want this to show on Person create page, but should appear is DB table column
public DateTime DateCreated { get; set; }
}