Exemplo n.º 1
0
 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());
     }
 }
Exemplo n.º 2
0
 public async Task <CustomerDTO> Create(CustomerCreateDTO customerCreate)
 {
     return(Mapper.Map <CustomerDTO>(
                await CustomerCreateService.CreateAsync(Mapper.Map <CustomerUpdateModel>(customerCreate))));
 }