Searching users
Log in to add to favouritesSearching users can be achieved by using one of the Search methods.
- Search(SecuritySearchOptions securitySearchOptions)
- SearchAsync(SecuritySearchOptions securitySearchOptions)
Search users specifying options.
Syntax
public PagedList<User> Search(SecuritySearchOptions securitySearchOptions)
{
}
Parameters
securitySearchOptions
Type: SecuritySearchOptions
The search options, query, ordering and paging, etc
Examples
using Zengenti.Contensis.Management;
using Zengenti.Data;
// Create a client
var client = ManagementClient.Create();
SecuritySearchOptions securitySearchOptions = new SecuritySearchOptions
{
PageIndex = 0,
PageSize = 10,
OrderBy = new List<string>{"username"},
Where = new IExpression[]
{
new OrExpression(
new Contains("email", "zengenti"),
new EqualTo<string>("username", "zengenti")
)
}
};
// Search the users
PagedList<User> users = client.Security.Users.Search(securitySearchOptions);
Search users asynchronously specifying options.
Syntax
public Task<PagedList<User>> SearchAsync(SecuritySearchOptions securitySearchOptions)
{
}
Parameters
securitySearchOptions
Type: SecuritySearchOptions
The search options, query, ordering and paging, etc
Examples
using Zengenti.Contensis.Management;
using Zengenti.Data;
// Create a client
var client = ManagementClient.Create();
SecuritySearchOptions securitySearchOptions = new SecuritySearchOptions
{
PageIndex = 0,
PageSize = 10,
OrderBy = new List<string>{"username"},
Where = new IExpression[]
{
new OrExpression(
new Contains("email", "zengenti"),
new EqualTo<string>("username", "zengenti")
)
}
};
// Search the users
PagedList<User> users = await client.Security.Users.SearchAsync(securitySearchOptions);