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.
You can achive it like that:
youPropertyInfo.GetCustomAttributes(typeof(NotMappedAttribute), true).Count() > 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With