public IActionResult CreateNewExpense(ExpensesDTO newExpense) { newExpense.purchaseDate = DateTime.Today; var addNewExpense = _repo.AddExpense(newExpense); return(Ok(addNewExpense)); }
public IActionResult CreateExpense([FromBody] Expenses NewObj) { if (!ModelState.IsValid) { BadRequest(); } if (NewObj == null) { BadRequest(); } _ExpensesRepo.AddExpense(NewObj); return(NoContent()); }
public int Post([FromBody] ExpensesEntity value) { var id = _repository.AddExpense(value); return(id); }