Click or drag to resize

UserFactoryFindAllReachableRecursively Method

Recursively find all non-deleted users reachable by the specified user.

Namespace:  AskiaPortalCmn
Assembly:  AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax
public static IEnumerable<IUser> FindAllReachableRecursively(
	IContext context,
	IUser user
)

Parameters

context
Type: AskiaPortalCmnIContext
Context of execution
user
Type: AskiaPortalCmnIUser
User for who to find reachable users.

Return Value

Type: IEnumerableIUser
Return an object to iterate through the list of groups.
Examples

Recursively find all users reachable by 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 users = USerFactory.FindAllReachableRecursively(context, context.User);
foreach(IUser user in users)
{
    Console.WriteLine($"User Id={user.Id}: {user.Name}");
}
See Also