示例#1
0
 public string Format <T, TPivot>(
     ICollection <T> items,
     IList <string> properties,
     ListPivot <T, TPivot> pivot)
     where T : class
     where TPivot : class =>
 FormatIternal(items, properties, BuildPivotWriter <T, TPivot>(items, pivot));
示例#2
0
 public string Format <T, TPivot>(ICollection <T> items, ListPivot <T, TPivot> pivot)
     where T : class
     where TPivot : class =>
 Format(
     items,
     BuildPropertyList(typeof(T)).Where(x => !Compare.EqualOrdinal(x, pivot.PropertyName)).ToList(),
     pivot);
示例#3
0
        public byte[] GetAsCsv <T, TPivot>(
            ICollection <T> collection,
            ListPivot <T, TPivot> pivot)
            where T : class
            where TPivot : class
        {
            Guard.NotNull(collection, nameof(collection));
            var csvText = _formatter.Format <T, TPivot>(collection, pivot);

            return(Encoding.GetBytes(csvText));
        }
示例#4
0
 private static ListPivotWriter <T, TPivot> BuildPivotWriter <T, TPivot>(
     ICollection <T> items,
     ListPivot <T, TPivot> pivot)
     where T : class
     where TPivot : class =>
 ListPivotWriter <T, TPivot> .GetWriter(items, pivot);