Click or drag to resize

UserFactoryFindAllMembers Method

Find all non-deleted users members of the specified group.

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

Parameters

context
Type: AskiaPortalCmnIContext
Context of execution
group
Type: AskiaPortalCmnIGroup
Group for who to find all members.

Return Value

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

Find all members of the specified group.

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

var group = GroupFactory.FindById(context, context.User.GroupId);
var users = UserFactory.FindAllMembers(context, group);
foreach(IUser user in users)
{
    Console.WriteLine($"User Id={user.Id}: {user.Name}");
}
See Also