Example #1
0
        public async Task <IActionResult> Delete(Guid id)
        {
            if (id == Guid.Empty)
            {
                return(RedirectToAction("Index"));
            }

            var successful = await _toDoItemService.DeleteAsync(id);

            if (!successful)
            {
                return(BadRequest("Could not delete this item."));
            }

            return(RedirectToAction("Index"));
        }