I know I am bit late to this party but I was looking to the answer to same question and couldn't find it anywhere on the web. In the end I worked it out myself.
The short answer is yes you can have multiple attributes of the same type that implement IMetadataAware interface on the same field / property. You just have to remember to override the TypeId of the Attribute class when extending it and replace it with something that will give you a unique object per instance of each derived attribute.
If you don't override the TypeId property of derived attribute then all the attributes of that type are treated the same since the default implementation returns the run time type of the attribute as the id.
So the following should now work as desired:
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public class DisplayForUserTypeAttribute : Attribute, IMetadataAware
{
private readonly UserType _userType;
public DisplayForUserType(UserType userType)
{
_userType = userType;
}
public override object TypeId
{
get
{
return this;
}
}
public string Name { get; set; }
public void OnMetadataCreated(ModelMetadata metadata)
{
if (CurrentContext.UserType != _userType)
return;
metadata.DisplayName = Name;
}
}