public SeparatedValueResult(ISeparatedValueTypeWriter <T> writer, SeparatedValueOptions options = null, string fileName = null, string contentType = null) { if (writer == null) { throw new ArgumentNullException("writer"); } if (options == null) { options = new SeparatedValueOptions(); } if (String.IsNullOrWhiteSpace(fileName)) { fileName = "file.txt"; } if (contentType == null) { contentType = "text/plain"; } this.writer = writer; this.options = options; this.fileName = fileName; this.contentType = contentType; }
public SeparatedValueResult(ISeparatedValueTypeMapper <T> mapper, IEnumerable <T> data, SeparatedValueOptions options = null, string fileName = null, string contentType = null) { if (mapper == null) { throw new ArgumentNullException("mapper"); } if (data == null) { throw new ArgumentNullException("data"); } if (String.IsNullOrWhiteSpace(fileName)) { fileName = "file.txt"; } if (contentType == null) { contentType = "text/plain"; } this.writer = mapper.ToWriter(data); this.options = options; this.fileName = fileName; this.contentType = contentType; }