public async Task <IActionResult> CleanTmpFolders() { var pathList = new List <string> () { Path.Combine(_hostingEnvironment.ContentRootPath, "AfterExtract"), Path.Combine(_hostingEnvironment.ContentRootPath, "AfterTransform") }; await _fileLoader.CleanFolders(pathList); return(Ok()); }
public async Task LoadFromFiles() { await InitSender(WorkMode.Partial); var path = Path.Combine(_hostingEnvironment.ContentRootPath, "AfterExtract"); foreach (var fileContent in _fileLoader.GetNextFileContent(path)) { await Transform(fileContent); } await _fileLoader.CleanFolders(new List <string>() { path }); }
public async Task LoadFromFiles() { var beforeLoadCount = await GetNumgerOfRecords(); var path = Path.Combine(_hostingEnvironment.ContentRootPath, "AfterTransform"); foreach (var fileContent in _fileLoader.GetNextFileContent(path)) { await Load(fileContent); } var afterLoadCount = await GetNumgerOfRecords(); _logger.Log($"Load {afterLoadCount - beforeLoadCount} records to database"); await _fileLoader.CleanFolders(new List <string>() { path }); }