private Type GetFirstLevelAttributeType(Type attributeType)
{
var next = attributeType;
while (next != typeof(Attribute) && next != typeof(Object) && next != null)
{
attributeType = next;
next = next.GetTypeInfo().BaseType;
}
return attributeType;
}
}