ResourceManagementClientGetResource Method (Guid) |
Namespace: Lithnet.ResourceManagement.Client
public ResourceObject GetResourceByGuid(Guid id) { ResourceManagementClient client = new ResourceManagementClient(); // Specify the list of attributes that we are interested in List<string> attributesToGet = new List<string>() { "DisplayName", "FirstName", "LastName" }; try { ResourceObject resource = client.GetResource(id); if (resource == null) { // The resource was not found, throw an exception throw new ResourceNotFoundException(); } return resource; } catch (TooManyResultsException) { // More than one match was found throw; } }