Click or drag to resize

ResourceManagementClientCreateResourceTemplateForUpdate Method

Creates a template of an existing object that can be used to save to the resource management service at a later stage. As this is an empty template, there is no. validation performed on value changes. It is recommended to use and perform the update against the real object

Namespace:  Lithnet.ResourceManagement.Client
Assembly:  Lithnet.ResourceManagement.Client (in Lithnet.ResourceManagement.Client.dll) Version: 1.0.6435.24467
Syntax
public ResourceObject CreateResourceTemplateForUpdate(
	string objectType,
	UniqueIdentifier id
)

Parameters

objectType
Type: SystemString
The type of object to create the template for
id
Type: UniqueIdentifier
The ID of the object to update

Return Value

Type: ResourceObject
An empty template of an existing object that can be updated in the resource management service when saved
Examples
The following example shows how to create a blank template of an object used to update the Resource Management Service
Example
public void CreateResource()
{
    ResourceManagementClient client = new ResourceManagementClient();
    UniqueIdentifier knownID = new UniqueIdentifier("5f491363-4d59-42f9-8f6c-8fd92cd1fb92");

    // Create a template to update a resource with a known ID
    ResourceObject resource = client.CreateResourceTemplateForUpdate("Person", knownID);

    resource.Attributes["DisplayName"].SetValue("Test User 3");

    try
    {
        resource.Save();
    }
    catch (Exception)
    {
        // An error occurred while updating the resource
        throw;
    }
}
See Also