public async override Task <IList <UserLoginInfo> > GetLoginsAsync(User user, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); user.CheakArgument(); var userId = user.Id; return(await UserLogins.Where(l => l.UserId.Equals(userId)) .Select(l => new UserLoginInfo(l.LoginProvider, l.ProviderKey, l.ProviderDisplayName)).ToListAsync()); }
/// <summary> /// Retrieves the associated logins for the specified <param ref="user"/>. /// </summary> /// <param name="user">The user whose associated logins to retrieve.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> used to propagate notifications that the operation should be canceled.</param> /// <returns> /// The <see cref="Task"/> for the asynchronous operation, containing a list of <see cref="UserLoginInfo"/> for the specified <paramref name="user"/>, if any. /// </returns> public async override Task <IList <UserLoginInfo> > GetLoginsAsync(User user, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); if (user == null) { throw new ArgumentNullException(nameof(user)); } var userId = user.Id; return(await UserLogins.Where(l => l.UserId.Equals(userId)) .Select(l => new UserLoginInfo(l.LoginProvider, l.ProviderKey, l.ProviderDisplayName)).ToListAsync(cancellationToken)); }