Find Users
Finds Users matching your criteria. The Users.Find
method supports a fluent style where you can chain together your search criteria.
Method Signature
UsersPage Find(Search.Filter filter = null, PagingOptions pagingOptions = null);
async Task<UsersPage> FindAsync(Search.Filter filter = null, PagingOptions pagingOptions = null);
Parameters
Parameter | Type | Description |
---|---|---|
filter | Search.Filter | The filter criteria to search by, or null to fetch all Users. |
pagingOptions | PagingOptions | paging options including Size and PageToken |
returns | UsersPage | The requested page of Users |
You can search for matches among the following attributes of the Where
class.
Name | Type | Description |
---|---|---|
Text | string | Match against the user's Full Name |
returns | UsersPage | The requested page of Users |
Example
/*
* This example demonstrates listing all users
*/
using Catalytic.Sdk;
using Catalytic.Sdk.Entities;
using System;
using System.Linq;
using System.Collections.Generic;
namespace Catalytic.Sdk.Examples
{
class Program
{
static void Main(string[] args)
{
var catalytic = new CatalyticClient(Credentials.Default);
var users = new List<User>();
var paging = new PagingOptions { Size = 25 };
while(paging != null)
{
var result = catalytic.Users.Find(
null,
paging
);
users.AddRange(result.Users);
paging = result.NextPageOptions;
}
// users now contains all matching Users
foreach(var user in users)
{
Console.WriteLine(user.Email);
}
}
}
}
Updated almost 4 years ago