UserProfileFactoryFindAllForUser Method |
Find all user profiles available for the specified user.
Namespace:
AskiaPortalCmn
Assembly:
AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax public static IEnumerable<IUserProfile> 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 IUserProfile)
public:
static IEnumerable<IUserProfile^>^ FindAllForUser(
IContext^ context,
IUser^ user,
QueryAllFilter filter = QueryAllFilter::NotDeleted
)
Parameters
- context
- Type: AskiaPortalCmnIContext
Context of execution - user
- Type: AskiaPortalCmnIUser
User for who to find available user profiles. - filter (Optional)
- Type: AskiaPortalCmn.CommonQueryAllFilter
Filter to apply on query.
Return Value
Type:
IEnumerableIUserProfileReturn an object to iterate through the list of user profiles.
Examples
Find all user profiles available 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);
foreach(IUserProfile profile in profiles)
{
Console.WriteLine($"User profile Id={profile.Id}: {profile.Name}");
}
See Also