Esempio n. 1
0
        public async void Delete(int id)
        {
            var matchingTask = _allReadyDataAccess.GetTask(id);

            if (matchingTask != null)
            {
                bool hasPermissions = HasTaskEditPermissions(matchingTask);
                if (!hasPermissions)
                {
                    HttpUnauthorized();
                }
                await _allReadyDataAccess.DeleteTaskAsync(matchingTask.Id);
            }
        }
 protected override async Task HandleCore(DeleteTaskCommandAsync message)
 {
     await dataAccess.DeleteTaskAsync(message.TaskId);
 }
Esempio n. 3
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            await _dataAccess.DeleteTaskAsync(id);

            return(RedirectToAction("Index"));
        }