ResourceManagementClientGetResource Method (String, Boolean) |
Gets a resource from the resource management service, retrieving all attributes for the resource
Namespace:
Lithnet.ResourceManagement.Client
Assembly:
Lithnet.ResourceManagement.Client (in Lithnet.ResourceManagement.Client.dll) Version: 1.0.6435.24467
Syntaxpublic ResourceObject GetResource(
string id,
bool getPermissionHints
)
Public Function GetResource (
id As String,
getPermissionHints As Boolean
) As ResourceObject
public:
ResourceObject^ GetResource(
String^ id,
bool getPermissionHints
)
Parameters
- id
- Type: SystemString
The ID of the resource to get as a GUID in string format - getPermissionHints
- Type: SystemBoolean
Gets the permission hints for each attribute of the resource
Return Value
Type:
ResourceObjectThe resource represented by the specified ID
Examples
The following example shows how to get an object from a known GUID value
public ResourceObject GetResourceByGuidString(string id)
{
ResourceManagementClient client = new ResourceManagementClient();
List<string> attributesToGet = new List<string>() { "DisplayName", "FirstName", "LastName" };
try
{
ResourceObject resource = client.GetResource(id);
if (resource == null)
{
throw new ResourceNotFoundException();
}
return resource;
}
catch (TooManyResultsException)
{
throw;
}
}
See Also