public Task RunImport(IServiceScope serviceScope) { try { _unitOfWorkProvider = serviceScope.ServiceProvider.GetRequiredService <IUnitOfWorkProvider>(); _synchronizeStampService = serviceScope.ServiceProvider.GetRequiredService <ISynchronizeStampService>(); _api = serviceScope.ServiceProvider.GetRequiredService <IEnovaAPiClient>(); _stamp = _synchronizeStampService.GetImportStampAsync(SynchronizeCode, SynchronizeDirection).Result; _dbts = _api.GetDbtsAsync().Result; IEnumerable <TEntry> entries; using (var uow = _unitOfWorkProvider.CreateReadOnly()) { entries = GetEntriesAsync(_stamp, _dbts).Result; } if (entries.Any()) { Parallel.ForEach(entries, GetParrallelOptions(), ProcessEntryCore); } _synchronizeStampService.SaveImportStampAsync(SynchronizeCode, _dbts, SynchronizeDirection).Wait(); } catch (Exception ex) { HandleImportExeception(ex); } return(Task.CompletedTask); }
public EnovaProductRepository(IEnovaAPiClient enovaAPiClient) : base(enovaAPiClient) { }
protected EnovaGenericGuidedEntityRepository(IEnovaAPiClient enovaAPiClient) : base(enovaAPiClient) { }
protected EnovaGenericEntityRepository(IEnovaAPiClient enovaAPiClient) { Api = enovaAPiClient; }
public EnovaCustomerRepository(IEnovaAPiClient enovaAPiClient) : base(enovaAPiClient) { }