public async Task <IActionResult> Post([FromBody] Models.Saving saving) { if (saving == null) { //_logger.LogInformation($"User is empty when accessing to UserController/Post(UserDto saving)."); return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var savingEntity = _mapper.Map <Entities.Saving>(saving); await _savingRepository.AddAsync(savingEntity); if (!await _savingRepository.SaveAsync()) { // _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.")); } //TODO: Implement Realistic Implementation return(Created("", null)); }
public System.Threading.Tasks.Task <int> AddSavingAsync(Models.Saving saving, Models.Warehouse warehouse) { return(base.Channel.AddSavingAsync(saving, warehouse)); }
public int AddSaving(Models.Saving saving, Models.Warehouse warehouse) { return(base.Channel.AddSaving(saving, warehouse)); }