public IActionResult CreateRating(RatingForCreationOrUpdateDto ratingUpdateDto) { var ratings = _mapper.Map <RatingHistory>(ratingUpdateDto); _dataService.CreateRating(ratings); return(Created("", ratings)); }
public IActionResult UpdateRating(int id, RatingForCreationOrUpdateDto ratingUpdateDto) { var ratings = _mapper.Map <RatingHistory>(ratingUpdateDto); ratings.UserId = id; //this fixes the id null value if (!_dataService.UpdateRating(ratings)) { return(NotFound()); } return(NoContent()); }