Exemplo n.º 1
0
        public override async Task <bool> Handle(CreateModelsAggregateCommand command, CancellationToken token)
        {
            _logger.LogInformation("Models aggregate created with name: " + command.name);

            var model = new ModelsEntity(command.name);

            model.setVisibility(Visibility.FromName <Visibility>(command.visibility));
            model.setClassifiction(Classification.FromName <Classification>(command.classification));

            _models.Create(model);

            if (_models.GetById(model.Id) == null)
            {
                _logger.LogInformation("Could not create models entity: " + command.name);
            }

            await Task.CompletedTask;

            return(true);
        }