public RegisterUserCommand(string userName, string firstName, string secondName, string email, Gender gender, DateTime birthDate, string password, string confirmPassword) { Id = AggregateId.Generate(); UserName = userName; FirstName = firstName; SecondName = secondName; Email = email; Gender = gender; BirthDate = birthDate; Password = password; ConfirmPassword = confirmPassword; }
public async Task HandleAsync(DomainCommandContext context, AddGameProfileCommand command) { var game = await _gameRepository.LoadAsync(command.GameId); if (game == null) { await context.EmitAsync(new ErrorOccuredNotification()); return; } var gameProfileTemplate = game.Profiles.SingleOrDefault(entity => entity.Id == (AggregateId)command.BasedOnGameProfileId); if (gameProfileTemplate == null) { await context.EmitAsync(new ErrorOccuredNotification()); return; } var gameProfile = game.AddGameProfile( AggregateId.Generate(), command.Name, gameProfileTemplate.ProxyDirectoryPath, gameProfileTemplate.LogsDirectoryPath, gameProfileTemplate.PluginType, gameProfileTemplate.Direct3D11Settings); await _gameRepository.SaveAsync(game); await _processWatcher.WatchAsync(game.Id); var @event = new GameProfileAddedEvent( game.Id, game.ProfileId, gameProfile.Map <GameProfile>()); await context.PublishAsync(@event); }
public UsageStatistics Create() { return(new UsageStatistics(AggregateId.Generate())); }
public AddPairCommand(AggregateId likedUserId) { Id = AggregateId.Generate(); LikedUserId = likedUserId; }