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