示例#1
0
 public static string DefaultConvention(ArrayItemContext context)
 {
     return context.Member
         .PipeWhen(x => x.Type.Map(y => y.IsEnumerable && !y.IsSimpleType))
         .MapOrDefault(x => x.GetAttribute<XmlArrayItemAttribute>())
         .MapOrDefault(x => x.ElementName)
         .PipeWhen(x => !x.IsEmpty());
 }
示例#2
0
 public static string DefaultConvention(ArrayItemContext context)
 {
     return(context.Member
            .PipeWhen(x => x.Type.Map(y => y.IsEnumerable && !y.IsSimpleType))
            .MapOrDefault(x =>
                          x.MapOrDefault(y => y.GetAttribute <XmlArrayItemAttribute>())
                          .MapOrDefault(y => y.ElementName) ??
                          x.MapOrDefault(y => y.GetAttribute <XmlSiblingsAttribute>())
                          .MapOrDefault(y => y.ElementName))
            .PipeWhen(x => !x.IsEmpty()));
 }