Пример #1
0
        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);
        }
Пример #2
0
 public EnovaProductRepository(IEnovaAPiClient enovaAPiClient) : base(enovaAPiClient)
 {
 }
Пример #3
0
 protected EnovaGenericGuidedEntityRepository(IEnovaAPiClient enovaAPiClient) : base(enovaAPiClient)
 {
 }
 protected EnovaGenericEntityRepository(IEnovaAPiClient enovaAPiClient)
 {
     Api = enovaAPiClient;
 }
Пример #5
0
 public EnovaCustomerRepository(IEnovaAPiClient enovaAPiClient) : base(enovaAPiClient)
 {
 }