Exemplo n.º 1
0
        public IActionResult CreateExpense(Expense expense)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            _repo.Add(expense);
            _repo.SaveAll();

            // var expenseToReturn = _mapper.Map<ExpensesForListDto>(expense);
            return(Created(new Uri(Request.Path + "/" + expense.Id), expense));
        }