src/Folke.Identity.Elm/UserStore.cs
/// <summary>
///     Get the names of the roles a user is a member of
/// </summary>
/// <param name="user"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Get the names of the roles a user is a member of
Get the names of the roles a user is a member of
public virtual async Task<IList<string>> GetRolesAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }
            return
                (await
                    connection.Select<IdentityUserRole<TUser, TKey>>()
                        .Value(x => x.Role.Name)
                        .From()
                        .LeftJoinOnId(x => x.Role)
                        .Where(x => x.User == user)
                        .ToListAsync()).Select(x => x.Role.Name).ToList();
        }
public virtual async Task < IList < string > > GetRolesAsync ( TUser user , CancellationToken cancellationToken = default ( CancellationToken ) ) { cancellationToken . ThrowIfCancellationRequested ( ) ; ThrowIfDisposed ( ) ; if ( user == null ) { throw new ArgumentNullException ( nameof ( user ) ) ; } return ( await connection . Select < IdentityUserRole < TUser , TKey > > ( ) . Value ( x => x . Role . Name ) . From ( ) . LeftJoinOnId ( x => x . Role ) . Where ( x => x . User == user ) . ToListAsync ( ) ) . Select ( x => x . Role . Name ) . ToList ( ) ; }
Get the names of the roles a user is a member of
Get the names of the roles a user is a member of
None
user
TUser
None
cancellationToken
CancellationToken
None