Get Custom Attributes applied to generated entities via MetadataType attribute
问题 In our application, we are using EF4.0 and POCO Entity generator to generate Entities from the database. To apply data annotation, we are creating Interfaces and implementing those interfaces on the partial classes we have created to match the partial class generated by using EF. /*Entity Generated Type*/ public partial class SomeEntity : EntityBase { public virtual string SomeProperty { get {...} set {...} } } /*Interface containing metadata*/ public interface ISomeEntityMetadata {