CAML - <Query>
<Where>
<And>
<BeginsWith>
<FieldRef Name="ContentTypeId" />
<Value Type="ContentTypeId">0x0100</Value>
</BeginsWith>
<Eq>
<FieldRef Name="ClientCity" />
<Value Type="Lookup">Chicago</Value>
</Eq>
</And>
</Where>
</Query>
<ViewFields>
<FieldRef Name="Title" />
<FieldRef Name="ClientTitle" />
<FieldRef Name="BudgetHours" />
</ViewFields>
<ProjectedFields>
<Field Name="ClientTitle" Type="Lookup"
List="Client" ShowField="Title" />
<Field Name="ClientCity" Type="Lookup"
List="Client" ShowField="City" />
</ProjectedFields>
<Joins>
<Join Type="LEFT" ListAlias="Client">
<!--List Name: Clients-->
<Eq>
<FieldRef Name="Client" RefType="ID" />
<FieldRef List="Client" Name="ID" />
</Eq>
</Join>
</Joins>
LINQ -
from p in data.Projects where
p.Client.City == "Chicago" select new
{
Name = p.Title,
ClientName = p.Client.Title,
Budget = p.BudgetHours
};
Ads by Google
No comments:
Post a Comment