public IActionResult DeleteExpenses(int id) { if (id < 0) { return(BadRequest()); } _ExpensesRepo.DeleteExpense(id); return(Ok()); }
public async Task <IHttpActionResult> Delete(string guidString) { try { Guid guid = Guid.Parse(guidString); _repository.DeleteExpense(guid); return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }
public IActionResult DeleteExpense(string id) { var userId = User.FindFirstValue(ClaimTypes.NameIdentifier); if (string.IsNullOrEmpty(userId)) { return(Unauthorized()); } if (_expensesRepository.DeleteExpense(id, userId)) { return(NoContent()); } return(NotFound()); }
public async Task <IActionResult> DeleteExpenses([FromRoute] int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var expenses = await _expensesRepository.GetExpense(id); if (expenses == null) { return(NotFound()); } await _expensesRepository.DeleteExpense(expenses); await _expensesRepository.Save(); return(Ok(expenses)); }
public ActionResult Delete(string settlementId, Guid expenseId) { _expensesRepository.DeleteExpense(settlementId, expenseId); return(Ok()); }
public int Delete(int id) => expensesRepository.DeleteExpense(id);
public async Task DeleteExpense(int id) { await _expensesRepository.DeleteExpense(id); }