private static IList <IMetadataCustomAttribute> GetSubjectAttributes(IMetadataEntity metadataEntity, SubjectAttributeFullName subjectAttributeFullName) { return(metadataEntity.AndAllBaseTypes() .SelectMany(x => x.GetCustomAttributes(new SubjectAttributeFullName())) .ToList()); }
private static IList <IMetadataCustomAttribute> GetSubjectAttributes(IMetadataEntity type, SubjectAttributeFullName subjectAttributeFullName) { return(type.CustomAttributes .Where(attribute => attribute .AndAllBaseTypes() .Any(i => i.FullyQualifiedName == subjectAttributeFullName)) .ToList()); }
private static IList <IMetadataCustomAttribute> GetSubjectAttributes(IMetadataEntity metadataEntity, SubjectAttributeFullName subjectAttributeFullName) { var derivedAndBaseTypes = metadataEntity.AndAllBaseTypes(); foreach (var type in derivedAndBaseTypes) { var attributes = type.CustomAttributes.ToList().Where(x => x.GetCustomAttributes(subjectAttributeFullName) != null); if (attributes.Any()) { return(attributes.ToList()); } } return(new List <IMetadataCustomAttribute>()); }