public async Task <int> Handle(UpdateSupplierCommand request, CancellationToken cancellationToken)
        {
            var model = new Domain.OxiServi.AggregatesModel.SuppliersAggregate.Supplier();

            model.Update(request.SupplierId, request.CompanyName, request.ContactName, request.ContactTitle, request.Address, request.City, request.Region, request.PostalCode, request.Country, request.Phone, request.Fax, request.HomePage);
            return(await _supplierRepository.Update(model));
        }
示例#2
0
        public async Task <int> Handle(DeleteSupplierCommand request, CancellationToken cancellationToken)
        {
            var model = new Domain.OxiServi.AggregatesModel.SuppliersAggregate.Supplier();

            model.Delete(request.SupplierId);
            return(await _supplierRepository.Delete(model));
        }
示例#3
0
        public async Task <int> Handle(CreateSupplierCommand request, CancellationToken cancellationToken)
        {
            var model = new Domain.OxiServi.AggregatesModel.SuppliersAggregate.Supplier();

            model.Create(request.CompanyName, request.ContactName, request.ContactTitle, request.Address, request.City, request.Region, request.PostalCode, request.Country, request.Phone, request.Fax, request.HomePage);

            int validation = 0;

            if (validation >= default(int))
            {
                return(await _supplierRepository.Create(model));
            }
            else
            {
                return(validation);
            }
        }