public AppContext() { _appProfile = AppProfile.FromConfig(); _dataSourceConfig = new DataSourceConfig( _appProfile.DataSource, _appProfile.Database, _appProfile.Username, _appProfile.Password ); _addressRepository = new AddressRepository(_dataSourceConfig); _billingInfoRepository = new BillingInfoRepository(_dataSourceConfig, _addressRepository); _contactInfoRepository = new ContactInfoRepository(_dataSourceConfig); _supplierRepository = new SupplierRepository(_dataSourceConfig, _billingInfoRepository, _contactInfoRepository); _receiverRepository = new ReceiverRepository(_dataSourceConfig, _billingInfoRepository, _contactInfoRepository); _itemRepository = new InvoiceItemRepository(_dataSourceConfig); _paymentRepository = new InvoicePaymentRepository(_dataSourceConfig); _invoiceRepository = new InvoiceRepository(_dataSourceConfig, _supplierRepository, _receiverRepository, _itemRepository, _paymentRepository ); _addressService = new AddressService(_addressRepository); _billingInfoService = new BillingInfoService(_billingInfoRepository); _contactInfoService = new ContactInfoService(_contactInfoRepository); _supplierService = new SupplierService(_supplierRepository); _receiverService = new ReceiverService(_receiverRepository); _itemService = new InvoiceItemService(_itemRepository); _paymentService = new InvoicePaymentService(_paymentRepository); _invoiceService = new InvoiceService(_invoiceRepository); }
public BillingInfoController(IBillingInfoService service, IMapper mapper) { _service = service; _mapper = mapper; }