Пример #1
0
        private IProduceOrchestra Context()
        {
            IRepositoryAsync <Produce>      divisionRepository     = new Repository <Produce>(context, unitOfWork);
            IRepositoryAsync <MasterGroup>  masterGroupRepository  = new Repository <MasterGroup>(context, unitOfWork);
            IRepositoryAsync <ProduceGroup> produceGroupRepository = new Repository <ProduceGroup>(context, unitOfWork);
            ICache               cache               = Cache.Get(CacheType.Memory);
            IProduceService      produceService      = new ProduceService(divisionRepository, cache);
            IMasterGroupService  masterGroupService  = new MasterGroupService(masterGroupRepository, cache);
            IProduceGroupService produceGroupService = new ProduceGroupService(produceGroupRepository, cache);

            IProduceOrchestra produceOrchestra = new ProduceOrchestra(produceService, masterGroupService, produceGroupService);

            return(produceOrchestra);
        }
Пример #2
0
        public UnitOfWork(SaleManagementContext context)
        {
            this._context             = context;
            this._produceService      = new ProduceService(context);
            this._produceGroupService = new ProduceGroupService(context);

            this._staffService      = new StaffService(context);
            this._staffGroupService = new StaffGroupService(context);

            this._customerService = new CustomerService(context);
            this._unitService     = new UnitService(context);
            this._supplierService = new SupplierService(context);
            this._stockService    = new StockService(context);

            this._receiptNoteService  = new ReceiptNoteService(context);
            this._deliveryNoteService = new DeliveryNoteService(context);
        }