public virtual IUserLoginState Get(LoginKey loginKey, bool forCreation, bool nullAllowed) { UserLoginId globalId = new UserLoginId(_userState.UserId, loginKey); if (_loadedUserLoginStates.ContainsKey(globalId)) { return(_loadedUserLoginStates[globalId]); } if (forCreation || ForReapplying) { var state = new UserLoginState(ForReapplying); state.UserLoginId = globalId; _loadedUserLoginStates.Add(globalId, state); return(state); } else { var state = UserLoginStateDao.Get(globalId, nullAllowed); if (state != null) { _loadedUserLoginStates.Add(globalId, state); } return(state); } }
public virtual IUserLoginState ToUserLoginState() { var state = new UserLoginState(true); state.LoginKey = this.LoginKey; if (this.Active != null && this.Active.HasValue) { state.Active = this.Active.Value; } if (this.Version != null && this.Version.HasValue) { state.Version = this.Version.Value; } state.UserId = this.UserId; state.CreatedBy = this.CreatedBy; if (this.CreatedAt != null && this.CreatedAt.HasValue) { state.CreatedAt = this.CreatedAt.Value; } state.UpdatedBy = this.UpdatedBy; if (this.UpdatedAt != null && this.UpdatedAt.HasValue) { state.UpdatedAt = this.UpdatedAt.Value; } return(state); }
public static CreateUserLogin ToCreateUserLogin(this UserLoginState state) { return(state.ToCreateUserLogin <CreateUserLogin>()); }
public static MergePatchUserLogin ToMergePatchUserLogin(this UserLoginState state) { return(state.ToMergePatchUserLogin <MergePatchUserLogin>()); }
public static RemoveUserLogin ToRemoveUserLogin(this UserLoginState state) { return(state.ToRemoveUserLogin <RemoveUserLogin>()); }
public static IUserLoginCommand ToCreateOrMergePatchUserLogin(this UserLoginState state) { return(state.ToCreateOrMergePatchUserLogin <CreateUserLogin, MergePatchUserLogin>()); }