コード例 #1
0
        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);
            }
        }
コード例 #2
0
        public async Task<IActionResult> DeleteConfirmed(int id) {
            await _dataAccess.DeleteTask(id);

            return RedirectToAction("Index");
        }