public IActionResult Delete(int id) { var debit = _rep.GetDebitById(id); if (debit == null) { return(BadRequest("Debit not found!")); } _rep.Delete(debit); if (_rep.SaveChanges()) { return(Ok(debit)); } return(BadRequest("Debit was not deleted!")); }
public IActionResult Delete(int id) { var category = _rep.GetCategoryById(id); if (category == null) { return(BadRequest("Category not found!")); } _rep.Delete(category); if (_rep.SaveChanges()) { return(Ok(category)); } return(BadRequest("Category was not deleted!")); }
public IActionResult Delete(int id) { var payment = _rep.GetPaymentMethodById(id); if (payment == null) { return(BadRequest("Payment Method not found!")); } _rep.Delete(payment); if (_rep.SaveChanges()) { return(Ok(payment)); } return(BadRequest("Payment Method was not deleted!")); }