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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor of Billing factory.
 /// </summary>
 /// <param name="ctx">DB Context inherited from Base Facory</param>
 /// <param name="repository">Class type repository injection</param>
 /// <param name="mapper">Automapper injection</param>
 /// <param name="addressFactory">Address factory injection</param>
 public BillingInfoFactory(ManagementSystemContext ctx, IBillingInfoRepository repository, IMapper mapper, IAddressFactory addressFactory) :
     base(ctx)
 {
     _addressFactory = addressFactory;
     _repository     = repository;
     _mapper         = mapper;
 }
Ejemplo n.º 3
0
 public BillingInfoService(IBillingInfoRepository repository, IMapper mapper, ILogger <BillingInfoDTO> logger,
                           IBillingInfoFactory factory)
 {
     _repository = repository;
     _mapper     = mapper;
     _logger     = logger;
     _factory    = factory;
 }
Ejemplo n.º 4
0
 public SupplierRepository(
     IDataSourceConfig dataSource,
     IBillingInfoRepository billingInfoRepository,
     IContactInfoRepository contactInfoRepository
     )
 {
     _dataSource            = dataSource;
     _billingInfoRepository = billingInfoRepository;
     _contactInfoRepository = contactInfoRepository;
 }
Ejemplo n.º 5
0
 public BillingInfoService(IBillingInfoRepository repository)
 {
     _repository = repository;
 }