public async Task <IActionResult> Add(StudentResponseInputViewModel viewModel) { IActionResult result = View(); if (ModelState.IsValid) { using (var httpClient = ClientFactory.CreateClient("GeorestApi")) { try { var georestClient = new GeorestClient(httpClient.BaseAddress.ToString(), httpClient); await georestClient.AddStudentResponseAsync(viewModel); result = RedirectToAction(nameof(Index)); } catch (SwaggerException se) { ModelState.AddModelError("", se.Message); } } } return(result); }