public async Task <IActionResult> Details(int id) { try { Owner owner = await _vehicleManagementAPI.GetOwnerById(id); var model = new VehicleOwnerManagementDetailsViewModel { Owner = owner }; return(View(model)); } catch (Exception ex) { return(View("Offline", new VehicleOwnerManagementOfflineViewModel())); } }
public async Task <Owner> GetOwnerById([AliasAs("id")] int ownerId) { try { return(await _client.GetOwnerById(ownerId)); } catch (ApiException ex) { if (ex.StatusCode == HttpStatusCode.NotFound) { return(null); } else { throw; } } }