Exemplo n.º 1
0
        public async Task <IActionResult> MarkCompleted(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Error"));
            }

            if (!ModelState.IsValid)
            {
                return(RedirectToAction("Index"));
            }

            var task = await _repo.FindByIdAsync(id.Value);

            task.IsCompleted = true;
            await _repo.UpdateAsync(task);

            return(RedirectToAction("Index"));
        }