예제 #1
0
 public async Task <IActionResult> Delete(Guid id)
 {
     if (ResponseHasErrors(await _todoAppService.Remove(id)))
     {
         return(View(await _todoAppService.GetById(id)));
     }
     ViewBag.Sucess = "Task removed";
     return(RedirectToAction("Index"));
 }
예제 #2
0
 public void Delete(int id)
 {
     try
     {
         if (id != 0)
         {
             _todoApp.Remove(_todoApp.GetById(id));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
 public async Task <IActionResult> Delete(Guid id)
 {
     return(CustomResponse(await _todoAppService.Remove(id)));
 }
예제 #4
0
 public IActionResult Remove(string title)
 {
     TodoAppService.Remove(title);
     return(View("Index", TodoAppService.GetAll()));
 }