Exemple #1
0
 public async Task <IActionResult> Update([FromForm] VehicleOwnerManagementNewViewModel inputModel)
 {
     try
     {
         if (ModelState.IsValid)
         {
             return(await _resiliencyHelper.ExecuteResilient(async() =>
             {
                 RegisterOwner cmd = new RegisterOwner(new Guid(),
                                                       inputModel.Owner.OwnerId,
                                                       inputModel.Owner.RazonSocial,
                                                       inputModel.Owner.CIF,
                                                       inputModel.Owner.Direccion,
                                                       inputModel.Owner.Contacto,
                                                       inputModel.Owner.Telefono);
                 await _vehicleManagementAPI.UpdateOwner(cmd);
                 return RedirectToAction("Index");
             }, View("Offline", new VehicleOwnerManagementOfflineViewModel())));
         }
         else
         {
             return(View("New", inputModel));
         }
     }
     catch (Exception)
     {
         return(View("Offline", new VehicleOwnerManagementOfflineViewModel()));
     }
 }
 public async Task UpdateOwner(RegisterOwner command)
 {
     await _client.UpdateOwner(command);
 }