Ejemplo n.º 1
0
        public async Task <IActionResult> Details(string licenseNumber)
        {
            return(await _resiliencyHelper.ExecuteResilient(async() =>
            {
                Vehicle vehicle = await _vehicleManagementAPI.GetVehicleByLicenseNumber(licenseNumber);
                Customer customer = await _customerManagementAPI.GetCustomerById(vehicle.OwnerId);

                var model = new VehicleManagementDetailsViewModel
                {
                    Vehicle = vehicle,
                    Owner = customer.Name
                };
                return View(model);
            }, View("Offline", new VehicleManagementOfflineViewModel())));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Details(string licenseNumber)
        {
            return(await ExecuteWithFallback(async() =>
            {
                Vehicle vehicle = await _vehicleManagementAPI.GetVehicleByLicenseNumber(licenseNumber);
                Customer customer = await _customerManagementAPI.GetCustomerById(vehicle.OwnerId);

                var model = new VehicleManagementDetailsViewModel
                {
                    Vehicle = vehicle,
                    Owner = customer.Name
                };
                return View(model);
            }));
        }
Ejemplo n.º 3
0
 public async Task <Vehicle> GetVehicleByLicenseNumber([AliasAs("id")] string licenseNumber)
 {
     try
     {
         return(await _client.GetVehicleByLicenseNumber(licenseNumber));
     }
     catch (ApiException ex)
     {
         if (ex.StatusCode == HttpStatusCode.NotFound)
         {
             return(null);
         }
         else
         {
             throw;
         }
     }
 }