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

            return(RedirectToAction("Index"));
        }