Reputation: 3234
If I have the PropertyInfo
for a property or the MVC MetaData for that property, how can I detect whether it has the [NotMapped]
annotation from EF CodeFirst? Thanks.
Upvotes: 6
Views: 1202
Reputation: 332
You can achive it like that:
youPropertyInfo.GetCustomAttributes(typeof(NotMappedAttribute), true).Count() > 1
Upvotes: 8