I need to insert a property in the template class, but when I enter the code first, it says that the table already exists and changes have been made.
My code:
public class Data
{
[Key]
public int Id { get; set; }
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
public Nullable<System.DateTime> Date { get; set; }
//public bool Selected { get; set; }
public virtual ICollection<Comment> Comments { get; set; }
}
If I uncheck the Selected property it gives this error:
The model backing the 'Context' context has changed since the database was created. Consider using Code First Migrations to update the database ( link ).
How can I mark this property not to generate in the bank?