public async Task <IActionResult> Edit(int id) { InstructorViewModel fetchedInstructor = null; using (var httpClient = ClientFactory.CreateClient("GeorestApi")) { try { var georestClient = new GeorestClient(httpClient.BaseAddress.ToString(), httpClient); fetchedInstructor = await georestClient.GetInstructorByIdAsync(id); } catch (SwaggerException se) { ModelState.AddModelError("", se.Message); } } return(View(fetchedInstructor)); }