Esempio n. 1
0
        public async Task <IActionResult> OnPostSampleOutputFileAsync()
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

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

            try
            {
                FileResponse file = await client.GetSampleOutputAsync(PostData.ProblemId, PostData.TestCaseId);

                return(File(file.Stream, "text/plain", $"{PostData.TestCaseId}.out"));
            }
            catch
            {
                return(NotFound());
            }
        }