private static CustomAttributeMetadata InstantiateCustomAttributeWithType( CustomAttributeMetadata customAttributeTemplate, TypeMetadata typeMetadata) { return(new CustomAttributeMetadata( customAttributeTemplate.AttributeType, customAttributeTemplate.NamedArguments, customAttributeTemplate.PositionalArguments)); }
private static IImmutableList <CustomAttributeMetadata> GetCustomAttributes(IEnumerable <CustomAttributeData> customAttributeData) { var customAttributes = new List <CustomAttributeMetadata>(); foreach (CustomAttributeData customAttribute in customAttributeData) { var customAttributeMetadata = new CustomAttributeMetadata( FromType(customAttribute.AttributeType), GetNamedArguments(customAttribute), GetPositionalArguments(customAttribute) ); customAttributes.Add(customAttributeMetadata); } return(customAttributes.ToImmutableArray()); }