Пример #1
0
        public async Task <IActionResult> OnPostDeleteSampleAsync()
        {
            if ((await GetModifyAuthorization()) == false)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            HttpClient     httpclient = clientFactory.CreateClient();
            ProblemsClient client     = new ProblemsClient(httpclient);

            try
            {
                await client.DeleteSampleAsync(PostData.ProblemId, PostData.TestCaseId);

                return(RedirectToPage(new { id = PostData.ProblemId }));
            }
            catch
            {
                return(NotFound());
            }
        }