Exemplo n.º 1
0
        private void Initialize(RegisterUserInputDto user, EntityDependency[] dependencies)
        {
            RegisterCommandRepositoryFactory <User>(() => new UserCommandRepository());

            var salt = Password.SaltInBase64();

            RootEntity = new User
            {
                Username     = user.Username,
                Email        = user.Email,
                PasswordSalt = salt,
                PasswordHash = Password.ToHashBase64(user.Password, salt)
            };

            Enqueue(new InsertEntityCommandOperation <User>(RootEntity, dependencies));
        }
Exemplo n.º 2
0
 public RegisterUserCommandAggregate(RegisterUserInputDto user, EntityDependency[] dependencies = null) : base(new DomainFramework.DataAccess.RepositoryContext(RegisterUserConnectionClass.GetConnectionName()))
 {
     Initialize(user, dependencies);
 }