Export (0) Print
Expand All

EntityCollection.ResourceEntity property

Gets metadata for the resource entity type.

Namespace:  Microsoft.Office.Project.Server.Library
Assembly:  Microsoft.Office.Project.Server.Library (in Microsoft.Office.Project.Server.Library.dll)

public Entity ResourceEntity { get; }

Use EntityCollection.Entities.ResourceEntity.UniqueId to obtain the GUID of the resource entity for use in PSI methods.

The following code fragment uses the resource entity GUID in order to get all of the resource custom fields with the ReadCustomFieldsByEntity method. WebSvcCustomFields is the arbitrary name of a reference to the CustomFields.asmx Web service.

using PSLibrary = Microsoft.Office.Project.Server.Library;
. . .
public static WebSvcCustomFields.CustomFields customFields =
    new WebSvcCustomFields.CustomFields();
. . .
string resourceEntity = PSLibrary.EntityCollection.Entities.ResourceEntity.UniqueId;

WebSvcCustomFields.CustomFieldDataSet cfDs = customFields.ReadCustomFieldsByEntity(
    new Guid(resourceEntity));
. . .
Show:
© 2015 Microsoft