EntitySet: Resources (ProjectData service)

Office 2013

Last modified: October 05, 2012

In this article
Definition
Attributes
Parent element
Child elements

Specifies the collection of resources in the ReportingData schema.


<EntitySet Name="Resources" EntityType="ReportingData.Resource" />

Attribute

Value

Description

Name

Resources

The name of the entity set.

EntityType

ReportingData.Resource

The type of entity.

Element

Description

EntityContainer element: ReportingData

Contains definitions of entity sets for internal use in queries of the online Reporting database.

The Resources entity set has a default maximum page limit of 100 resources in one query. For information about how to query for more than 100 resources, and how to get and set the page limit, see ProjectData - OData service reference.

The following statement uses LINQ query syntax to retrieve Resource entity data from the OData interface of the Project Server reporting tables. To use the statement in an application, set a service reference to the ProjectDataService, and initialize the ReportingData context. The Resources entity set can then be accessed as context.Resources. For more information, see Querying OData feeds for Project 2013 reporting data.


var query =
    from r in Resources
    orderby r.ResourceName
    where (r.ResourceCount > (Int32)0)
    select new
    {
        ResourceName = r.ResourceName,
        ResourceEarliestAvailableFrom = r.ResourceEarliestAvailableFrom,
        ResourceStandardRate = r.ResourceStandardRate,
        ResourceMaxUnits = r.ResourceMaxUnits
    };


The preceding statement can be written by using Lambda expression syntax, as follows:


var query = Resources
    .OrderBy(r => r.ResourceName)
    .Where(r => (r.ResourceCount > (Int32)0))
    .Select(r => new
    {
        ResourceName = r.ResourceName,
        ResourceEarliestAvailableFrom = r.ResourceEarliestAvailableFrom,
        ResourceStandardRate = r.ResourceStandardRate,
        ResourceMaxUnits = r.ResourceMaxUnits
    });


Either statement creates the following REST URL (all on one line).

http://ServerName/pwa/_vti_bin/client.svc/ProjectServerData/Resources()?
    $orderby=ResourceName&
    $filter=ResourceCount gt 0&
    $select=ResourceName,ResourceEarliestAvailableFrom,ResourceStandardRate,ResourceMaxUnits

All three of the sample queries get the same data.

Sample results of the Resources query

ResourceName

ResourceEarliestAvailableFrom

ResourceStandardRate

ResourceMaxUnits

Resource1

3/4/2012 8:00:00 AM

$19.00

100%

Resource2

3/2/2012 8:00:00 AM

$18.00

100%

Resource3

3/3/2012 8:00:00 AM

$15.50

100%

Show:
© 2014 Microsoft