Example #1
0
 /// <summary>
 /// Creates a StockService.
 /// </summary>
 /// <param name="entityQuerySource">EntityQuerySource to run queries against the persistent storage.</param>
 /// <param name="entityRepositoryFactory">EntityRepositoryFactory to make changes to the persistent storage.</param>
 /// <param name="accountTransactionsAggregator"></param>
 /// <param name="stockInfoService"></param>
 public StockService(IEntityQuerySource entityQuerySource, IEntityRepositoryFactory entityRepositoryFactory, AccountTransactionsAggregator accountTransactionsAggregator, IStockInfoService stockInfoService)
 {
     _entityQuerySource             = entityQuerySource;
     _entityRepositoryFactory       = entityRepositoryFactory;
     _stockInfoService              = stockInfoService;
     _accountTransactionsAggregator = accountTransactionsAggregator;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="UnitOfWork{TDbContext}" /> class.
        /// </summary>
        /// <param name="entityRepositoryFactory">The entity repository factory.</param>
        public UnitOfWork(IEntityRepositoryFactory entityRepositoryFactory)
        {
            // The unit of work is responsible for creating/disposing the DbContext
            this.InstantiateContext();

            this.entityRepositoryFactory = entityRepositoryFactory;
            this.objectContext           = ((IObjectContextAdapter)this.DbContext).ObjectContext;
        }
Example #3
0
 /// <summary>
 /// Creates a StockImportService.
 /// </summary>
 /// <param name="entityQuerySource">EntityQuerySource to run queries against the persistent storage.</param>
 /// <param name="entityRepositoryFactory">EntityRepositoryFactory to make changes to the persistent storage.</param>
 /// <param name="stockQueryService">Service to query the current list of available stocks.</param>
 public StockImportService(IEntityQuerySource entityQuerySource, IEntityRepositoryFactory entityRepositoryFactory, IStockQueryService stockQueryService)
 {
     _entityQuerySource       = entityQuerySource;
     _entityRepositoryFactory = entityRepositoryFactory;
     _stockQueryService       = stockQueryService;
 }
 public CommandExecutor(IHistoryRepositoryFactory historyRecorder,
                        IEntityRepositoryFactory entityRepository)
 {
     _historyRepositoryFactory = historyRecorder ?? throw new ArgumentNullException(nameof(historyRecorder));
     _entityRepositoryFactory  = entityRepository ?? throw new ArgumentNullException(nameof(entityRepository));
 }
Example #5
0
 public UnitOfWork(IEntityRepositoryFactory entityRepositoryFactory)
 {
     _webSearcherContext      = new WebSearcherContext();
     this.WebPages            = entityRepositoryFactory.CreateEntityRepository <WebPage>(_webSearcherContext);
     this.WebPagesConnections = entityRepositoryFactory.CreateEntityRepository <WebPageConnection>(_webSearcherContext);
 }
Example #6
0
 /// <summary>
 /// Creates an AccountService.
 /// </summary>
 /// <param name="entityQuerySource">EntityQuerySource to run queries against the persistent storage.</param>
 /// <param name="entityRepositoryFactory">EntityRepositoryFactory to make changes to the persistent storage.</param>
 public AccountService(IEntityQuerySource entityQuerySource, IEntityRepositoryFactory entityRepositoryFactory)
 {
     _entityQuerySource       = entityQuerySource;
     _entityRepositoryFactory = entityRepositoryFactory;
 }
Example #7
0
 public GetRegisteredVaccineCountQueryHandler(IEntityRepositoryFactory entityRepositoryFactory)
 {
     _entityRepositoryFactory = entityRepositoryFactory;
 }