Exemplo n.º 1
0
        public User(TenantId tenantId, string userName, string password, Enablement enablement, Person person)
        {
            this.TenantId = tenantId;
            this.UserName = userName;
            this.Enablement = enablement;
            this.Person = person;

            ProtectPassword("", password);

            person.User = this;

            DomainEventPublisher.Instance.Publish(new UserRegistered(
                tenantId, userName, person.Name, person.ContactInformation.EmailAddress));
        }
Exemplo n.º 2
0
 public virtual User.User RegisterUser(string invitationIdentifier, string userName, string password,
     Enablement enablement, Person person)
 {
     AssertionConcern.True(this.Active, "Tenant is not active.");
     User.User user = null;
     if(this.IsRegistrationAvailableThrough(invitationIdentifier)) {
         person.TenantId = this.TenantId;
         user = new User.User(this.TenantId, userName, password, enablement, person);
     }
     return user;
 }