示例#1
0
        public IActionResult CreateRating(RatingForCreationOrUpdateDto ratingUpdateDto)
        {
            var ratings = _mapper.Map <RatingHistory>(ratingUpdateDto);

            _dataService.CreateRating(ratings);

            return(Created("", ratings));
        }
示例#2
0
        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());
        }