Esempio n. 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));
Esempio n. 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);
Esempio n. 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));
        }
Esempio n. 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);