public async Task <IActionResult> Delete(int id)
        {
            DeletedTestResultDto deletedTestResultDto = await testResultService.DeleteTestResult(id);

            if (deletedTestResultDto == null)
            {
                return(NotFound());
            }

            return(NoContent());
        }
Beispiel #2
0
        public ActionResult DeleteTestResult(int?id, int page = 1)
        {
            if (!ReferenceEquals(id, null))
            {
                _testResultService.DeleteTestResult(Convert.ToInt32(id));
            }
            var model = new ProfileViewModel();

            model.User = _userService.GetUserByEmail(User.Identity.Name).ToMvcUser();
            List <TestResultDTO> tests;

            tests = model.User.TestResults.Reverse().ToList();
            model.User.TestResults = model.User.TestResults.Reverse().Skip((page - 1) * 2).Take(2).ToList();
            model.PageInfo         = new PageInfoViewModel(page, 2, tests.Count, null);
            if (Request.IsAjaxRequest())
            {
                return(PartialView("Information", model));
            }
            return(RedirectToAction("Information"));
        }