public async Task <IActionResult> OnPostCreateSampleAsync() { if ((await GetModifyAuthorization()) == false) { return(Forbid()); } if (!ModelState.IsValid) { ShowId = PostData.TestCaseId; if (await GetData(PostData.ProblemId)) { return(Page()); } else { return(NotFound()); } } HttpClient httpclient = clientFactory.CreateClient(); ProblemsClient client = new ProblemsClient(httpclient); try { TestCaseMetadata tmeta = await client.CreateSampleAsync(PostData.ProblemId, PostData.TestCase); return(RedirectToPage(new { id = PostData.ProblemId, showId = tmeta.Id })); } catch { return(NotFound()); } }