I have a class that defines data annotations at class level. The meta data class has custom attributes associated with it, along with the usual DisplayName,
Based on the other answers, i'm successed to get the DisplayName attribute from MetadataType class in this way:
var metadataType = type.GetCustomAttributes(typeof(MetadataTypeAttribute), true)
.OfType().FirstOrDefault();
var metaData = (metadataType != null)
? ModelMetadataProviders.Current.GetMetadataForType(null, metadataType.MetadataClassType)
: ModelMetadataProviders.Current.GetMetadataForType(null, type);
List propertyList = metaData.Properties.
Select(x => x.DisplayName).ToList();