Ben*_*min 4 reflection asp.net-mvc entity-framework-4 ef-code-first entity-framework-4.1
如果我拥有该PropertyInfo属性的属性或MVC MetaData,我如何检测它是否具有[NotMapped]EF CodeFirst 的注释?谢谢.
你可以这样做:
youPropertyInfo.GetCustomAttributes(typeof(NotMappedAttribute), true).Count() > 1
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
583 次 |
| 最近记录: |