public SQLiteDataRepository(string connectionString, IProgressLogger progressLogger) : base(connectionString, progressLogger) { SQLiteConnectionStringBuilder cnBuilder = new SQLiteConnectionStringBuilder(connectionString); this._fileName = cnBuilder.DataSource; }
public LegislationService(IMapper mapper, IProgressLogger progressLogger, IRepository <Legislation, int> legislationsRepository, IRepository <User, int> usersRepository) { _mapper = mapper; _progressLogger = progressLogger; _legislationsRepository = legislationsRepository; _usersRepository = usersRepository; }
/// <summary> /// Initializes a new instance of the <see cref="ProgressMonitor"/> class. /// </summary> /// <param name="progressLogger"> /// The progress logger. /// </param> public ProgressMonitor(IProgressLogger progressLogger) { this.cancellationTokenSource = new CancellationTokenSource(); var token = this.cancellationTokenSource.Token; this.progressLogger = progressLogger; if (this.progressLogger != null) { this.backgroundTask = Task.Run(() => this.RunLogProgressTask(token), token); } }
public DebtorFilesService(IMapper mapper, IProgressLogger progressLogger, IRepository <DebtorFile, int> debtorFilesRepository, IRepository <User, int> usersRepository, ConfigurationService configurationService) { _mapper = mapper; _progressLogger = progressLogger; _debtorFilesRepository = debtorFilesRepository; _usersRepository = usersRepository; _configurationService = configurationService; }
public ProgressMonitor(IProgressLogger progressLogger) { _cancellationTokenSource = new CancellationTokenSource(); var token = _cancellationTokenSource.Token; _progressLogger = progressLogger; if (_progressLogger != null) { _backgroundTask = Task.Run(() => LogProgress(token), token); } }
public PostsService(IRepository<Post, int> postsRepository, IPostViewRepository postsViewRepository, IRepository<User, int> usersRepository, IProgressLogger progressLogger, IMapper mapper) { _postsRepository = postsRepository; _postsViewRepository = postsViewRepository; _usersRepository = usersRepository; _progressLogger = progressLogger; _mapper = mapper; }
public AuthService(AuthSettings authSettings, IPasswordHashService passwordHashService, IProgressLogger progressLogger, IRepository <User, int> userRepository, IRepository <Role, int> rolesRepository, IRepository <UserToRole, int> userToRolesRepository) { _authSettings = authSettings; _passwordHashService = passwordHashService; _progressLogger = progressLogger; _userRepository = userRepository; _rolesRepository = rolesRepository; _userToRolesRepository = userToRolesRepository; }
public DocumentsService(IRepository <Document, int> documentsRepository, IProgressLogger progressLogger, IMapper mapper, IRepository <User, int> usersRepository, IViewRepository <DocumentView, int> documentViewsRepository, ConfigurationService configurationService) { _documentsRepository = documentsRepository; _progressLogger = progressLogger; _mapper = mapper; _usersRepository = usersRepository; _documentViewsRepository = documentViewsRepository; _configurationService = configurationService; }
public UsersService(IRepository <User, int> userRepository, IRepository <Role, int> rolesRepository, IRepository <UserToRole, int> userToRolesRepository, IMapper mapper, IPasswordHashService passwordHashService, IProgressLogger progressLogger) { _userRepository = userRepository; _rolesRepository = rolesRepository; _userToRolesRepository = userToRolesRepository; _mapper = mapper; _passwordHashService = passwordHashService; _progressLogger = progressLogger; }
public QuestionsService(IMapper mapper, IProgressLogger progressLogger, IRepository <Question, int> questionsRepository, IViewRepository <QuestionView, int> questionsViewRepository, IRepository <Choise, int> choisesRepository, IRepository <UserToChoise, int> userToChoisesRepository, IRepository <User, int> usersRepository) { _mapper = mapper; _progressLogger = progressLogger; _questionsRepository = questionsRepository; _questionsViewRepository = questionsViewRepository; _choisesRepository = choisesRepository; _userToChoisesRepository = userToChoisesRepository; _usersRepository = usersRepository; }
public AdvertisementsService(IMapper mapper, IProgressLogger progressLogger, IRepository <Advertisement, int> advertisementsRepository, IRepository <AdvertisementFile, int> advertisementFilesRepository, IViewRepository <AdvertisementView, int> advertisementViewsRepository, IRepository <User, int> usersRepository, ConfigurationService configurationService) { _mapper = mapper; _progressLogger = progressLogger; _advertisementsRepository = advertisementsRepository; _advertisementFilesRepository = advertisementFilesRepository; _advertisementViewsRepository = advertisementViewsRepository; _usersRepository = usersRepository; _configurationService = configurationService; }
public async Task PerformOperations( IReadOnlyList <ICreateJob <string, GoogleContactVersion, GoogleContactWrapper> > createJobs, IReadOnlyList <IUpdateJob <string, GoogleContactVersion, GoogleContactWrapper> > updateJobs, IReadOnlyList <IDeleteJob <string, GoogleContactVersion> > deleteJobs, IProgressLogger progressLogger, IGoogleContactContext context) { var createRequestsAndJobs = await CreateCreateRequests(createJobs); var updateRequestsAndJobs = await CreateUpdateRequests(updateJobs); await Task.Run(() => { AssignGroupsToContacts(createRequestsAndJobs.Item1, context.GroupCache); AssignGroupsToContacts(updateRequestsAndJobs.Item1.Values, context.GroupCache); try { RunCreateBatch(createRequestsAndJobs); } catch (Exception x) { s_logger.Error(null, x); } try { RunUpdateBatch(updateRequestsAndJobs); } catch (Exception x) { s_logger.Error(null, x); } try { RunDeleteBatch(deleteJobs); } catch (Exception x) { s_logger.Error(null, x); } }); }
public TxtImporter(IDataRepository dataRepository, IProgressLogger progressLogger) { this._dataRepository = dataRepository; this._progressLogger = progressLogger; }
/// <summary> /// Конструктор класса /// </summary> /// <param name="baseAddress">Базовый адрес</param> /// <param name="folder">Имя папки, с которой будем работать</param> /// <param name="progressLogger">Логгер (опционально)</param> public FileManager(string baseAddress, string folder, IProgressLogger progressLogger = null) { _baseAddress = baseAddress; _folder = folder; _progressLogger = progressLogger; }
public GovernmentService(IMapper mapper, IProgressLogger progressLogger, IRepository <User, int> usersRepository) { _mapper = mapper; _progressLogger = progressLogger; _usersRepository = usersRepository; }
public async Task PerformOperations(IReadOnlyList <ICreateJob <TEntityId, TEntityVersion, TEntity> > createJobs, IReadOnlyList <IUpdateJob <TEntityId, TEntityVersion, TEntity> > updateJobs, IReadOnlyList <IDeleteJob <TEntityId, TEntityVersion> > deleteJobs, IProgressLogger progressLogger, TContext context) { await Task.Run(() => _batchWriteOnlyEntityRepositoryImplementation.PerformOperations(createJobs, updateJobs, deleteJobs, progressLogger, context)); }
public DataRepositoryBase(string connectionString, IProgressLogger progressLogger) { this.ConnectionString = connectionString; this._progressLogger = progressLogger; }
public async Task PerformOperations( IReadOnlyList <ICreateJob <TEntityId, TEntityVersion, TEntity> > createJobs, IReadOnlyList <IUpdateJob <TEntityId, TEntityVersion, TEntity> > updateJobs, IReadOnlyList <IDeleteJob <TEntityId, TEntityVersion> > deleteJobs, IProgressLogger progressLogger, TContext context) { foreach (var job in createJobs) { try { var result = await _inner.Create(job.InitializeEntity, context); job.NotifyOperationSuceeded(result); } catch (Exception x) { if (_exceptionHandlingStrategy.DoesGracefullyAbortSynchronization(x)) { throw; } else { job.NotifyOperationFailed(x); } } progressLogger.Increase(); } foreach (var job in updateJobs) { try { var result = await _inner.TryUpdate(job.EntityId, job.Version, job.EntityToUpdate, job.UpdateEntity, context); if (result != null) { job.NotifyOperationSuceeded(result); } else { job.NotifyEntityNotFound(); } } catch (Exception x) { if (_exceptionHandlingStrategy.DoesGracefullyAbortSynchronization(x)) { throw; } else { job.NotifyOperationFailed(x); } } progressLogger.Increase(); } foreach (var job in deleteJobs) { try { if (await _inner.TryDelete(job.EntityId, job.Version, context)) { job.NotifyOperationSuceeded(); } else { job.NotifyEntityNotFound(); } } catch (Exception x) { if (_exceptionHandlingStrategy.DoesGracefullyAbortSynchronization(x)) { throw; } else { job.NotifyOperationFailed(x); } } progressLogger.Increase(); } }
public ValuePairsService(IRepository <ValuePair, int> valuePairsRepository, IProgressLogger progressLogger) { _valuePairsRepository = valuePairsRepository; _progressLogger = progressLogger; }