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