public TUser Create(string identity, string @namespace, string password, UserStatus status = UserStatus.Active, string description = null) { if (string.IsNullOrWhiteSpace(identity)) { throw new ArgumentNullException(nameof(identity)); } var user = this.CreateUser(null); user.Namespace = @namespace; user.Status = status; user.Description = string.IsNullOrEmpty(description) ? null : description; switch (MembershipUtility.GetIdentityType(identity)) { case UserIdentityType.Name: user.Name = identity; break; case UserIdentityType.Phone: user.Phone = identity; break; case UserIdentityType.Email: user.Email = identity; break; } return(this.Create(user, password) ? user : default);