I am using a code-first methodology. I have created my own user model and membership provider. My model has some of the following fields:
[Table("mytable")]
public class MyUser
{
[Key]
public int UserId { get; set; } // Auto generated
[Required]
[DataType(DataType.EmailAddress)]
[Display(Name = "Email address")]
public string Email { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
public string ConfirmPassword { get; set; }
[Display(Name = "Your name/company name")]
public string Name { get; set; }
}
The problem is that I don't have a ConfirmPassword column in my database (for obvious reasons). How do I "hide" this from the database, but allow the view to be able to see an use it. Changing it to private hides it from the database, but the view doesn't like that.
How can I tell Entity Framework to ignore this field?