EntityCollection.ProjectEntity property

Gets metadata for the project entity type.

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

Syntax

'Declaration
Public ReadOnly Property ProjectEntity As Entity
    Get
'Usage
Dim instance As EntityCollection
Dim value As Entity

value = instance.ProjectEntity
public Entity ProjectEntity { get; }

Property value

Type: Microsoft.Office.Project.Server.Library.Entity

Remarks

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

Examples

The following code fragment uses the project entity GUID in order to get all of the project 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 projectEntity = PSLibrary.EntityCollection.Entities.ProjectEntity.UniqueId;

WebSvcCustomFields.CustomFieldDataSet cfDs = customFields.ReadCustomFieldsByEntity(
    new Guid(projectEntity));
. . .

See also

Reference

EntityCollection class

EntityCollection members

Microsoft.Office.Project.Server.Library namespace