Reputation: 3035
I am trying a model property not to be mapped with the database table. I've found a solution for fluent API which is
modelBuilder.Entity<MODEL_NAME>().Ignore(t => t.PROPERTY_NAME);
I am wondering whether there is any equivalent data annotations for that. E.g. the following one
modelBuilder.Entity<MODEL_NAME>().Property(t => t.PROPERTY_NAME).IsRequired();
can be written as
[Required]
public string PROPERTY_NAME{ get; set; }
Upvotes: 0
Views: 107