Пример #1
0
        private async Task <Supplier> GetSupplierByName(string name, string userId)
        {
            var supplier = await _supplierRepository.GetByName(name, userId);

            if (supplier == null)
            {
                supplier = _supplierFactory.Create(name, userId);
                await _supplierRepository.Add(supplier);
            }

            return(supplier);
        }
Пример #2
0
        public override void Execute()
        {
            TypedResult = new AddSupplierResult();

            CheckIfSupplierExist();

            var supplier = supplierFactory.Create();

            supplier.Name = SupplierName;

            suppliersRepository.Add(supplier);

            TypedResult.Supplier = supplier;

            base.Execute();
        }
Пример #3
0
 public async Task Add(AddSupplierDto dto)
 {
     var supplier = _supplierFactory.Create(dto.Name, dto.UserId);
     await _supplierRepository.Add(supplier);
 }