Beispiel #1
0
 private string ToCreator(CompileAttribute attribute)
 {
     return($@"new {_attributeType}({string.Join(", ", attribute.GetValues())})
         {{
             {string.Join(@",
             ", attribute.GetProperties().Select(x => $"{x.property} = {x.value}"))}
         }}");
 }
Beispiel #2
0
 internal static string BuildTypeAttributeMetadata(CompileType type, CompileAttribute attribute,
                                                   string baseClassOrInterfaceName, string attributeName)
 {
     return($@"new AttributedTypeMetadata<{baseClassOrInterfaceName}, {attributeName}>(
             typeof({type.FullName}),
             new {attributeName}({string.Join(", ", attribute.GetValues())})
             {{
                 {string.Join(@",
                 ", attribute.GetProperties().Select(x => $"{x.property} = {x.value}"))}
             }},
             () => new {type.FullName}()
         )");
 }