Skip to main content
Browse Documentation

Delete a group

Created by Mike Andrews on 10 Jun 2020

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

Delete

Deletes a group.

Syntax

public void Delete()
{    
}

Examples

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

public async Task DeleteAsync()
{    
}

Examples

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();