public CsvReaderController( ICsvReaderService csvReaderService, ILogger <CsvReaderController> logger) { _csvReaderService = csvReaderService; _logger = logger; }
public ProcessFileController(IExcelReaderService excelReaderService, ICustomerService customerService, IHostingEnvironment hostingEnvironment, ICsvReaderService csvReaderService) { this._excelReaderService = excelReaderService; _customerService = customerService; _hostingEnvironment = hostingEnvironment; _csvReaderService = csvReaderService; }
public HandlerCsvJsonParser(ICsvReaderService csvReaderService, ICsvJsonParserService csvJsonParserService, ICreateJsonFileService createJsonFileService) { _csvReaderService = csvReaderService; _csvJsonParserService = csvJsonParserService; _createJsonFileService = createJsonFileService; }
public static async Task <List <TRecord> > ReadRecordsAsync <TRecord>(this ICsvReaderService csvReaderService, string fileName, ICsvContext csvContext) { Argument.IsNotNull(() => csvReaderService); Argument.IsOfType("csvContext.RecordType", csvContext.RecordType, typeof(TRecord)); var records = await csvReaderService.ReadRecordsAsync(fileName, csvContext); return(records.Cast <TRecord>().ToList()); }
public static List <TRecord> ReadRecords <TRecord>(this ICsvReaderService csvReaderService, StreamReader streamReader, ICsvContext csvContext) { Argument.IsNotNull(() => csvReaderService); Argument.IsOfType("csvContext.RecordType", csvContext.RecordType, typeof(TRecord)); var records = csvReaderService.ReadRecords(streamReader, csvContext); return(records.Cast <TRecord>().ToList()); }
public CsvParserService( ICsvReaderService csvReaderService, ICsvFilterService csvFilterService, IIndex <OutputFormats, ICsvPrinterService> printers, ILogger <CsvParserService> logger) { CsvReaderService = csvReaderService; CsvFilterService = csvFilterService; Printers = printers; Logger = logger; }
public static Task <List <TRecord> > ReadRecordsAsync <TRecord, TRecordMap>(this ICsvReaderService csvReaderService, string fileName, ICsvContext csvContext = null) where TRecordMap : ClassMap, new() { Argument.IsNotNull(() => csvReaderService); if (csvContext == null) { csvContext = new CsvContext <TRecord, TRecordMap>(); } return(ReadRecordsAsync <TRecord>(csvReaderService, fileName, csvContext)); }
public CsvReader(string source, ICsvReaderService csvReaderService, IFileService fileService) : base(source) { Argument.IsNotNullOrWhitespace(() => source); Argument.IsNotNull(() => csvReaderService); Argument.IsNotNull(() => fileService); _csvReaderService = csvReaderService; _fileService = fileService; Initialize(source); }
public static List <TRecord> ReadRecords <TRecord, TRecordMap>(this ICsvReaderService csvReaderService, StreamReader streamReader, ICsvContext csvContext = null) where TRecordMap : ClassMap, new() { Argument.IsNotNull(() => csvReaderService); if (csvContext == null) { csvContext = new CsvContext <TRecord, TRecordMap>(); } return(ReadRecords <TRecord>(csvReaderService, streamReader, csvContext)); }
public static CsvReader CreateReader(this ICsvReaderService csvReaderService, string fileName, ICsvContext csvContext) { Argument.IsNotNull(() => csvReaderService); var dependencyResolver = csvReaderService.GetDependencyResolver(); var fileService = dependencyResolver.Resolve <IFileService>(); // Note: don't dispose, the reader cannot be used when disposed var stream = fileService.OpenRead(fileName); var streamReader = new StreamReader(stream); return(csvReaderService.CreateReader(streamReader, csvContext)); }
public static IEnumerable ReadRecords(this ICsvReaderService csvReaderService, string fileName, ICsvContext csvContext) { Argument.IsNotNull(() => csvReaderService); var dependencyResolver = csvReaderService.GetDependencyResolver(); var fileService = dependencyResolver.Resolve <IFileService>(); using (var stream = fileService.OpenRead(fileName)) { using (var streamReader = new StreamReader(stream)) { var records = csvReaderService.ReadRecords(streamReader, csvContext); return(records); } } }
public ServiceMonitoringRepository( ICsvReaderService csvReaderService, ICSVWriterService cSVWriterService) { if (csvReaderService == null) { throw new ArgumentNullException(nameof(csvReaderService)); } if (cSVWriterService == null) { throw new ArgumentNullException(nameof(cSVWriterService)); } this.csvReaderService = csvReaderService; this.cSVWriterService = cSVWriterService; }
public ImportFileReaderService(ICsvReaderService csvReaderService) { _csvReaderService = csvReaderService; }
public LineupBuilderController(ICsvReaderService csvReaderService, ILineupBuilderService lineupBuilderService) { this.csvReaderService = csvReaderService; this.lineupBuilderService = lineupBuilderService; }