public BacsExportService() { IConfiguration Configuration = new ConfigurationBuilder() .AddJsonFile(APP_SETTINGS_PATH) .Build(); var documentStoreConfig = new DocumentStoreConfiguration(); agencyPaymentsConfiguration = new AgencyPaymentsConfiguration(); Configuration .GetSection(DOCUMENT_STORE_KEY) .Bind(documentStoreConfig); Configuration .GetSection(AGENCY_PAYMENTS_KEY) .Bind(agencyPaymentsConfiguration); documentStore = new DocumentStore { Urls = new[] { documentStoreConfig.Url }, Database = documentStoreConfig.Database }; documentStore.Initialize(); agencyPaymentService = new AgencyPaymentService(documentStore); supplierPaymentService = new SupplierPaymentService(); }
public BacsExportService(IDocumentStore documentStore, IAgencyPaymentsConfiguration agencyPaymentsConfiguration) { this.agencyPaymentsConfiguration = agencyPaymentsConfiguration; this.documentStore = documentStore; agencyPaymentService = new AgencyPaymentService(documentStore); supplierPaymentService = new SupplierPaymentService(); documentStore.Initialize(); }