Пример #1
0
        /// <summary>
        /// Writes the CSV data into a new stream and returns it.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="definition"></param>
        /// <param name="rows"></param>
        /// <returns></returns>
        public static MemoryStream WriteAsCsv <T>(this CsvDefinition <T> definition, T[] rows)
        {
            var stream = new MemoryStream();

            definition.WriteAsCsv(rows, stream);
            return(stream);
        }
Пример #2
0
 /// <summary>
 /// Writes the CSV data into a new stream and returns it.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="definition">The definition.</param>
 /// <param name="rows">The rows.</param>
 /// <returns> A MemoryStream object containing the rendered CSV data.</returns>
 public static MemoryStream CreateStream <T>(CsvDefinition <T> definition, T[] rows)
 {
     return(definition.WriteAsCsv <T>(rows));
 }