Skip to main content
Browse Documentation

Getting a user

Created by Mike Andrews, last updated 09 Jun 2020

Requesting an individual user can be achieved by using one of the Get methods overloads.

Gets a user by its identifier.

Syntax

public User Get(Guid id)
{    
}

Parameters

id

Type: Guid
The id of the user.

Remarks

Returns null if no user matches the specified id.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Mimic a guid value
var userId = Guid.Parse("c5da1719-cb3f-4f2e-927b-f678293258f3");

// Get the user
User user = client.Security.Users.Get(userId);

Gets a user by its identifier asynchronously.

Syntax

public async Task<User> GetAsync(Guid id)
{    
}

Parameters

id

Type: Guid
The id of the user.

Remarks

Returns null if no user matches the specified id.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Mimic a guid value
var userId = Guid.Parse("c5da1719-cb3f-4f2e-927b-f678293258f3");

// Get the user
User user = await client.Security.Users.GetAsync(userId);

Gets a user by its id identifier.

Syntax

public User Get(string id)
{    
}

Parameters

id

Type: string
The users identifier, either username, email address, or id.

Remarks

Returns null if no user matches the specified id.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = client.Security.Users.Get("c5da1719-cb3f-4f2e-927b-f678293258f3");

Gets a user by its id identifier asynchronously.

Syntax

public async Task<User> GetAsync(string id)
{    
}

Parameters

id

Type: string
The users identifier, either username, email address, or id.

Remarks

Returns null if no user matches the specified id.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = await client.Security.Users.GetAsync("c5da1719-cb3f-4f2e-927b-f678293258f3");

Gets a user by their username identifier.

Syntax

public User Get(string id)
{    
}

Parameters

id

Type: string
The users identifier, either username, email address, or id.

Remarks

Returns null if no user matches the specified username.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = client.Security.Users.Get("r.paulsen");

Gets a user by their username identifier asynchronously.

Syntax

public async Task<User> GetAsync(string id)
{    
}

Parameters

id

Type: string
The users identifier, either username, email address, or id.

Remarks

Returns null if no user matches the specified username.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = await client.Security.Users.GetAsync("r.paulsen");

Gets a user by their email address.

Syntax

public User Get(string id)
{    
}

Parameters

username

Type: string
The users identifier, either username, email address, or id.

Remarks

Returns null if no user matches the specified email address.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = client.Security.Users.Get("robert.paulsen@fightclub.com")

Gets a user by their email address asynchronously.

Syntax

public async Task<User> GetAsync(string id)
{    
}

Parameters

username

Type: string
The users identifier, either username, email address, or id.

Remarks

Returns null if no user matches the specified email address.

Examples

using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get the user
User user = await client.Security.Users.GetAsync("robert.paulsen@fightclub.com");