예제 #1
0
        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();
        }
예제 #2
0
        public BacsExportService(IDocumentStore documentStore, IAgencyPaymentsConfiguration agencyPaymentsConfiguration)
        {
            this.agencyPaymentsConfiguration = agencyPaymentsConfiguration;
            this.documentStore     = documentStore;
            agencyPaymentService   = new AgencyPaymentService(documentStore);
            supplierPaymentService = new SupplierPaymentService();

            documentStore.Initialize();
        }