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;
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public UsageStatistics Create()
 {
     return(new UsageStatistics(AggregateId.Generate()));
 }
Ejemplo n.º 4
0
 public AddPairCommand(AggregateId likedUserId)
 {
     Id          = AggregateId.Generate();
     LikedUserId = likedUserId;
 }