/// <summary> /// 获取用户信息 /// </summary> /// <param name="login">登录信息</param> /// <returns></returns> public Task <TUser> FindAsync(UserLoginInfo login) { if (login == null) { throw new ArgumentNullException("login"); } var userId = userLoginRepository.FindUserIdByLogin(login); if (userId != null) { TUser user = userRepository.GetUserById(userId) as TUser; if (user != null) { return(Task.FromResult(user)); } } return(Task.FromResult <TUser>(null)); }
/// <summary> /// Returns an TUser based on the Login info /// </summary> /// <param name="login"></param> /// <returns></returns> public Task <TUser> FindAsync(UserLoginInfo login) { if (login == null) { throw new ArgumentNullException("login"); } var userId = userLoginsRepo.FindUserIdByLogin(login); if (!string.IsNullOrEmpty(userId)) { TUser user = usersRepo.GetUserById(userId) as TUser; if (user != null) { return(Task.FromResult <TUser>(user)); } } return(Task.FromResult <TUser>(null)); }