Skip to main content

Deleting a user can be achieved by using one of the Delete method overloads.

Delete

Deletes a user.

Syntax

C#
public void Delete()
{    
}

Examples

C#
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);

// Delete the user
user.Delete();

Delete async

Deletes a user asynchronously.

Syntax

C#
public async Task DeleteAsync()
{    
}

Examples

C#
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);

// Delete the user
await user.DeleteAsync();

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request