UserTokenFactoryFindAllForUser Method |
Find all user tokens associated with the specified user,
return null if not found.
Namespace:
AskiaPortalCmn
Assembly:
AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax public static IEnumerable<IUserToken> FindAllForUser(
IContext context,
IUser user,
QueryAllFilter filter = QueryAllFilter.NotDeleted
)
Public Shared Function FindAllForUser (
context As IContext,
user As IUser,
Optional filter As QueryAllFilter = QueryAllFilter.NotDeleted
) As IEnumerable(Of IUserToken)
public:
static IEnumerable<IUserToken^>^ FindAllForUser(
IContext^ context,
IUser^ user,
QueryAllFilter filter = QueryAllFilter::NotDeleted
)
Parameters
- context
- Type: AskiaPortalCmnIContext
Context of execution. - user
- Type: AskiaPortalCmnIUser
User associated with the tokens to find. - filter (Optional)
- Type: AskiaPortalCmn.CommonQueryAllFilter
Filter to apply on query.
Return Value
Type:
IEnumerableIUserTokenReturn an object to iterate through the list of user profiles.
Examples
Find all user tokens for the specified user.
var context = ContextFactory.CreateByUserGuid(Guid.Parse("20BE5F84-F006-49A0-9674-4B16A090AF2D"));
var contextValidation = context.Validate();
if (!contextValidation.Success)
{
throw contextValidation.Exception;
}
var profiles = UserProfileFactory.FindAllForUser(context, context.User);
var tokens = UserTokenFactory.FindAllForUser(context, context.User);
foreach(IUserToken token in tokens)
{
Console.WriteLine($"User token Key={token.Key}, User Id={token.UserId}, Token={token.Token}");
}
See Also