Beispiel #1
0
        public async Task ValidateForCreation(FilmCommentForCreationDto filmCommentForCreation)
        {
            Validate(filmCommentForCreation);

            await ValidateFilm(filmCommentForCreation.FilmId, filmCommentForCreation.Comment);

            ThrowValidationErrorsIfNotEmpty();
        }
Beispiel #2
0
        public async Task <IActionResult> Create(FilmCommentForCreationDto filmCommentForCreation)
        {
            await _filmCommentValidatorService.ValidateForCreation(filmCommentForCreation);

            await _filmCommentService.Create(filmCommentForCreation);

            return(Ok());
        }
Beispiel #3
0
        public async Task Create(FilmCommentForCreationDto filmCommentForCreation)
        {
            var filmComment = _mapper.Map <Domain.Entities.FilmComment>(filmCommentForCreation);

            filmComment.UserId = (int)_currentUserService.UserId;

            _uow.Repository <Domain.Entities.FilmComment>().Add(filmComment);

            await _uow.SaveAsync();
        }