Click or drag to resize

GroupFactoryFindAllReachable Method (IContext, IUser, QueryAllFilter)

Find all groups reachable by the specified user.

Namespace:  AskiaPortalCmn
Assembly:  AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax
public static IEnumerable<IGroup> FindAllReachable(
	IContext context,
	IUser user,
	QueryAllFilter filter = QueryAllFilter.NotDeleted
)

Parameters

context
Type: AskiaPortalCmnIContext
Context of execution
user
Type: AskiaPortalCmnIUser
User for who to find reachable groups.
filter (Optional)
Type: AskiaPortalCmn.CommonQueryAllFilter
Filter to apply on query.

Return Value

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

Find all groups 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 groups = GroupFactory.FindAllReachable(context, context.User);
foreach(IGroup group in groups)
{
    Console.WriteLine($"Group Id={group.Id}: {group.Name}");
}
See Also