Ejemplo n.º 1
0
 public async Task <IActionResult> Register([FromForm] VehicleManagementNewViewModel inputModel)
 {
     return(await ExecuteWithFallback(async() =>
     {
         RegisterVehicle cmd = Mapper.Map <RegisterVehicle>(inputModel);
         await _vehicleManagementAPI.RegisterVehicle(cmd);
         return RedirectToAction("Index");
     }));
 }
Ejemplo n.º 2
0
 public async Task <IActionResult> Register([FromForm] VehicleManagementNewViewModel inputModel)
 {
     if (ModelState.IsValid)
     {
         return(await _resiliencyHelper.ExecuteResilient(async() =>
         {
             RegisterVehicle cmd = inputModel.MapToRegisterVehicle();
             await _vehicleManagementAPI.RegisterVehicle(cmd);
             return RedirectToAction("Index");
         }, View("Offline", new VehicleManagementOfflineViewModel())));
     }
     else
     {
         return(View("New", inputModel));
     }
 }
Ejemplo n.º 3
0
 public async Task RegisterVehicle(RegisterVehicle command)
 {
     await _client.RegisterVehicle(command);
 }