public IActionResult Delete(int?id) { if (id == null) { return(NotFound()); } _spendService.Delete((int)id, GetUserId()); return(RedirectToAction("Index")); }
public ActionResult <Spend> DeleteSpend(int id) { try { return(_spendService.Delete(id, GetUserId())); } catch (ItemNotFoundException ex) { return(NotFound(ex.Message)); } }