public Task Handle(ModelsCreatedIntegrationEvent @event) { // _logger.LogInformation("Created new transfer : " + @event.Amount); _entities.Create(new ModelsEntity(@event.ModelsID)); return(Task.CompletedTask); }
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); }