EntitySet: Projects (ProjectData service)
Last modified: May 19, 2015
In this article
Definition
Attributes
Parent element
Child elements
Specifies the collection of projects in the ReportingData schema.
var query = from p in Projects where p.ProjectStartDate > new DateTime(2012, 1, 1) orderby p.ProjectName select new { Project = p.ProjectName, StartDate = p.ProjectStartDate, FinishDate = p.ProjectFinishDate, ProjectCost = p.ProjectCost };
The preceding statement can be written by using Lambda expression syntax, as follows:
var query = Projects .Where(p => (p.ProjectStartDate > (DateTime?)(new DateTime(2012, 1, 1)))) .OrderBy(p => p.ProjectName) .Select(p => new { Project = p.ProjectName, StartDate = p.ProjectStartDate, FinishDate = p.ProjectFinishDate, ProjectCost = p.ProjectCost });
Either statement creates the following REST URL (all on one line).
http://ServerName/pwa/_vti_bin/client.svc/ProjectServerData/Projects()?
$filter=ProjectStartDate gt datetime'2012-01-01T00:00:00'&
$orderby=ProjectName&
$select=ProjectName,ProjectStartDate,ProjectFinishDate,ProjectCost
All three of the sample queries get the same data.
|
Project |
StartDate |
FinishDate |
ProjectCost |
|---|---|---|---|
|
ProjectA |
3/1/2012 8:00:00 AM |
3/15/2012 5:00:00 PM |
$1124.00 |
|
ProjectB |
3/1/2012 8:00:00 AM |
3/24/2012 5:00:00 PM |
$2171.00 |
|
ProjectC |
3/1/2012 8:00:00 AM |
3/17/2012 5:00:00 PM |
$1968.00 |
Each entity set has a specific page-size limit. For information about page limits for on-premises and online ProjectData queries and how to set the on-premises page limit, see ProjectData - OData service reference.