public async Task <IActionResult> Post([FromBody] Models.Income income) { //TODO: Check problems with date... if (income == null) { //_logger.LogInformation($"User is empty when accessing to UserController/Post(UserDto income)."); return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var isCreated = await _incomeService.AddIncome(income); if (isCreated) { return(Created("", null)); } else { // _logger.LogError($"Add User is not valid. Error in SaveAsync(). When accessing to UserController/Post"); return(StatusCode(500, "A problem happend while handling your request.")); } }
public virtual ActionResult AddIncome([FromBody] Income income) { var tempIncome = income; tempIncome.UserId = _idLoggedUser; return(Json(_incomeService.AddIncome(tempIncome), JsonRequestBehavior.AllowGet)); }
public void Post([FromBody] IncomeModel model) { service.AddIncome(model); }
public async Task <IActionResult> AddIncome([FromBody] RecordAddRequestModel model) { var response = await _incomeService.AddIncome(model); return(Ok(response)); }
public async Task <IActionResult> Purchase([FromBody] IncomeRequestModel incomeRequestModel) { await _incomeService.AddIncome(incomeRequestModel); return(Ok()); }
public async Task <IActionResult> Add(IncomeRequestModel model) { var income = await _incomeService.AddIncome(model); return(Ok(income)); }
public async Task <ActionResult> CreateIncome([FromBody] IncomeRequestModel incomeRequest) { await _incomeService.AddIncome(incomeRequest); return(Ok()); }