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()); }
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())); }