public async Task <IActionResult> Create(CustomerCreateDTO customerCreate) { try { var customer = Mapper.Map <CustomerDTO>( await CustomerCreateService.CreateAsync(Mapper.Map <CustomerUpdateModel>(customerCreate))); return(Redirect($"/customers/{customer.Id}")); } catch { return(View()); } }
public async Task <CustomerDTO> Create(CustomerCreateDTO customerCreate) { return(Mapper.Map <CustomerDTO>( await CustomerCreateService.CreateAsync(Mapper.Map <CustomerUpdateModel>(customerCreate)))); }