public async Task <ValidationResult> Handle(UpdateGameCommand message, CancellationToken cancellationToken) { if (!message.IsValid()) { return(message.ValidationResult); } var game = new GameModel(Guid.NewGuid(), message.Description, message.Active, message.Created, message.Updated); if (await _gameRepository.GetByDescription(game.Description) != null) { AddError("Game já cadastrado."); return(ValidationResult); } game.AddDomainEvent(new GameRegisteredEvent(game.Description, game.Active, game.Created, game.Updated)); _gameRepository.Update(game); return(await Commit(_gameRepository.UnitOfWork)); }