private IEnumerable<CustomAttributeData> GetAttributes()
{
var info = UnwrapNullable(metadata.PropertyType.GetTypeInfo());
foreach (var attribute in info.CustomAttributes)
{
yield return attribute;
}
foreach (var attribute in propertyInfo.CustomAttributes)
{
yield return attribute;
}
}