Esempio n. 1
0
        public IActionResult CreateNewExpense(ExpensesDTO newExpense)
        {
            newExpense.purchaseDate = DateTime.Today;
            var addNewExpense = _repo.AddExpense(newExpense);

            return(Ok(addNewExpense));
        }
Esempio n. 2
0
 public IActionResult CreateExpense([FromBody] Expenses NewObj)
 {
     if (!ModelState.IsValid)
     {
         BadRequest();
     }
     if (NewObj == null)
     {
         BadRequest();
     }
     _ExpensesRepo.AddExpense(NewObj);
     return(NoContent());
 }
Esempio n. 3
0
        public int Post([FromBody] ExpensesEntity value)
        {
            var id = _repository.AddExpense(value);

            return(id);
        }