public async void Delete(int id) { var matchingTask = _allReadyDataAccess.GetTask(id); if (matchingTask != null) { bool hasPermissions = await HasTaskEditPermissions(matchingTask); if (!hasPermissions) { HttpUnauthorized(); } await _allReadyDataAccess.DeleteTask(matchingTask.Id); } }
public async Task <IActionResult> DeleteConfirmed(int id) { await _dataAccess.DeleteTask(id); return(RedirectToAction("Index")); }