public Task <IList <UserLoginInfo> > GetLoginsAsync(IdentityUser user) { if (user == null) { throw new ArgumentNullException("user"); } var userLogins = _userLoginsRepository.FindByUserId(user.Id); return(Task.FromResult(userLogins)); }
/// <summary> /// 获取用户登录信息 /// </summary> /// <param name="user">用户信息</param> /// <returns>用户登录信息</returns> public Task <IList <UserLoginInfo> > GetLoginsAsync(TUser user) { List <UserLoginInfo> userLogins = new List <UserLoginInfo>(); if (user == null) { throw new ArgumentNullException("user"); } List <UserLoginInfo> logins = userLoginRepository.FindByUserId(user.Id); if (logins == null) { return(Task.FromResult <IList <UserLoginInfo> >(logins)); } return(Task.FromResult <IList <UserLoginInfo> >(null)); }