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

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

            return(id);
        }