public IActionResult OnGet(Guid id) { Task = _context.Find <Task>(id); if (Task == null) { return(RedirectToPage("Create")); } return(Page()); }
private IActionResult ChangeTaskStatus(Guid id, ETaskStatus current, ETaskStatus next) { var task = _context.Find <Task>(id); if (task != null && task.Status == current) { task.Status = next; _context.Update(task); _context.SaveChanges(); } Tasks = _context.Tasks.ToList(); Request.QueryString = default; return(RedirectToPage("Index")); }