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)); }
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; }