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