Skip to main content

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

Delete

Deletes a group.

Syntax

C#
public void Delete()
{    
}

Examples

C#
using Zengenti.Contensis.Management;

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

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

// Get the group
Group group = client.Security.Groups.Get(groupId);

// Delete the group
group.Delete();

Delete async

Deletes a group 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 groupId = Guid.Parse("c5da1719-cb3f-4f2e-927b-f678293258f3");

// Get the group
Group group = await client.Security.Groups.GetAsync(groupId);

// Delete the group
await group.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