コード例 #1
0
        public async Task <IActionResult> DeleteTask(int id)
        {
            bool add = await _repo2.AddToDeletedTasks(id);

            if (add == true)
            {
                bool deduct = await _repo2.DeductCost(id);

                if (deduct == true)
                {
                    bool success = await _repo2.DeleteTask(id);

                    return(RedirectToAction(nameof(GetTasks), new { delete = success }));
                }
            }

            return(null);
        }