public async Task <CreateCustomerResult> Handle(CreateCustomerCommand command, CancellationToken cancellationToken) { DBModels.Customer customer = _mapper.Map <CreateCustomerCommand, DBModels.Customer>(command); var result = await _customerRepository.CreateAsync(customer); return(_mapper.Map <DBModels.Customer, CreateCustomerResult>(result)); }
public ActionResult Delete([FromBody] DBModels.Customer customer) { _customerRepository.Delete(customer); return(Ok()); }
public ActionResult <DBModels.Customer> Put(int id, DBModels.Customer customer) { return(Ok(_customerRepository.Update(customer))); }