ResourceManagementClientDeleteResources Method (IEnumerableResourceObject) |
Deletes the specified resources from the resource management service as a single composite operation
Namespace:
Lithnet.ResourceManagement.Client
Assembly:
Lithnet.ResourceManagement.Client (in Lithnet.ResourceManagement.Client.dll) Version: 1.0.6435.24467
Syntaxpublic void DeleteResources(
IEnumerable<ResourceObject> resources
)
Public Sub DeleteResources (
resources As IEnumerable(Of ResourceObject)
)
public:
void DeleteResources(
IEnumerable<ResourceObject^>^ resources
)
Parameters
- resources
- Type: System.Collections.GenericIEnumerableResourceObject
A collection of resources to delete
Remarks
Note that when using this method, the objects are passed to the Resource Management Service in a single request. In the Request History in the portal, this will appear as a single request, and the individual object IDs that were deleted will not be visible.
Examples
The following example performs a search for all Group objects, and passes the resulting enumerable to the delete function
public void DeleteAllGroups()
{
ResourceManagementClient client = new ResourceManagementClient();
List<string> attributesToGet = new List<string>() { "ObjectID", "ObjectType" };
ISearchResultCollection resources = client.GetResources("/Group", attributesToGet);
try
{
client.DeleteResources(resources);
}
catch (Exception)
{
throw;
}
}
See Also