Ejemplo n.º 1
0
        public async Task <bool> Handle(AddCastCommand message, CancellationToken cancellationToken)
        {
            var cast = CastFactory.Create(message.Name, message.CastType);

            if (!cast.IsValid())
            {
                NotifyValidationErrors(cast.ValidationResult);
            }

            _movieRepository.AddCast(cast);

            return(await Task.FromResult(Commit()));
        }