Click or drag to resize

UserFactoryFindAllByGroupIds Method

Find all users (members) using a list of groups identifiers.

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

Parameters

context
Type: AskiaPortalCmnIContext
Context of execution
ids
Type: System.Collections.GenericIEnumerableInt32
Ids of the groups to find users
filter (Optional)
Type: AskiaPortalCmn.CommonQueryAllFilter
Filter to apply on query.

Return Value

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

Find all users using a list of groups identifiers.

var context = ContextFactory.CreateByUserGuid(Guid.Parse("20BE5F84-F006-49A0-9674-4B16A090AF2D"));   
var contextValidation = context.Validate();
if (!contextValidation.Success)
{
    throw contextValidation.Exception;
}

var users = UserFactory.FindAllByGroupIds(context, new List<int> {2, 3, 4});
foreach(IUser user in users)
{
    Console.WriteLine($"User Id={user.Id}: {user.Name}");
}
See Also