コード例 #1
0
        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));
        }