People,
I am developing a web application based on ASP.NET MVC 4.
Let's say I define a model, for example:
public class MyUser {
public string UserName { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
The database initializer code will automatically create a table with three columns - UserName, FirstName and LastName.
However, let's say I do not want LastName to be part of the database table.
Is there any data annotation attribute that I can use to prevent the object from appearing as a column?
Thank you in advance for your help.
Regards,
Peter
Peter source
share