<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Joins</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Joins</description>
  <pubDate>Tue, 28 Apr 2026 23:47:30 -700</pubDate>
  <lastBuildDate>Tue, 29 Dec 2009 12:15:11 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=1591</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Joins : Sorry, Michael, I&amp;#039;m not familiar...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=6003#6003</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 29-Dec-2009 at 12:15pm<br /><br />Sorry, Michael, I'm not familiar with the BuildContainsExpression() function. I believe the DevForce PredicateBuilder will do what you need, however, and it is well documented.]]>
   </description>
   <pubDate>Tue, 29 Dec 2009 12:15:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=6003#6003</guid>
  </item> 
  <item>
   <title>Joins : Thanks Greg for that nice explanation...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5999#5999</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=429" rel="nofollow">mbevins1</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 29-Dec-2009 at 4:38am<br /><br />Thanks Greg for that nice explanation however I am still having issues with the in clause part.&nbsp; My "helper" function is the BuildContainsExpression function found on microsofts website (found in one of the above links).&nbsp; I have not been able to figure out how to get it to work with the "Any" part?<DIV>&nbsp;</DIV><DIV>List&lt;int&gt; tempOperationList = new List&lt;int&gt;();<BR>tempOperationList.Add(1);<BR>tempOperationList.Add(4);<BR>tempOperationList.Add(7);</DIV><DIV>&nbsp;</DIV><DIV>IEntityQuery&lt;CustomerLocation&gt; search = _mgr.CustomerLocations<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(cl=&gt;cl.Territory.OperationsTerritories.Any(</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BuildContainsExpression&lt;OperationTerritory, int&gt;(e =&gt; e.Operation.OperationID, tempOperationList)</DIV><DIV>));</DIV>]]>
   </description>
   <pubDate>Tue, 29 Dec 2009 04:38:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5999#5999</guid>
  </item> 
  <item>
   <title>Joins :  Your issue is a basic one, so...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5993#5993</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 28-Dec-2009 at 11:52am<br /><br />Your issue is a basic one, so let's keep Helper, etc., out of it for now.<br><br>I try to use the NorthwindIB database when experimenting with and communicating about queries, for the following reasons:<br><ol><li>It's the only database that we (and others who will read this post) have in common.&nbsp; </li><li>It's a database that I actually <i>have</i>, and so can build an actual model against it, and so can do actual queries against, instead of just guessing or trying to reason out what will work.</li></ol>Once I've worked out a query, I can try to translate it to your database, but will have to guess as the associations between your tables until and if you give me a detailed account (which I'd prefer you didn't unless absolutely necessary).<br><br>Associations in NorthwindIB are as follows:<br>------------------------------------------------------<br>Customer&nbsp;&nbsp;&nbsp;&nbsp; -----o&nbsp; Order<br>Employee&nbsp;&nbsp;&nbsp;&nbsp; -----o&nbsp; Order<br>Order&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -----o&nbsp; OrderDetail<br>OrderDetail&nbsp; o-----&nbsp; Product<br>Product&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o-----&nbsp; Supplier<br><br>A Customer places many Orders: an Employee writes many Orders. An Order has many OrderDetails (line items). An OrderDetail references a single Product, but one Product can of course be represented in many OrderDetails. A Product has a single Supplier, but a Supplier may supply many Products.<br><br>Those are the six tables I use for most examples; however, I need to use an additional one in order to have a set of associations similar to what I think yours are:<br><br>Employee&nbsp;&nbsp;&nbsp;&nbsp; -----o&nbsp; EmployeeTerritories<br><br><br>Let's consider your query:<br><br>&nbsp;&nbsp; IEntityQuery&lt;CustomerLocation&gt; search = EntityManager.CustomerLocations<br>&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; .Where(cl =&gt; cl.Territory.OperationTerritories<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(ot =&gt; ot.Operation.OperationID == 1));<br><br>If I guess the associations from the plurality of the navigation properties, I can state this query in English as follows:<br><br>"Show me all CustomerLocations for which any related OperationTerritory's Operation is the one identified by ID=1."&nbsp; I also guess the following associations:<br><br>CustomerLocation&nbsp;&nbsp; o-----&nbsp; Territory<br>Territory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -----o&nbsp; OperationTerritories<br>OperationTerritory&nbsp; o-----&nbsp; Operation<br><br>Again, if I've guessed the details of the associations correctly, this is equivalent to the following query against NorthwindIB:<br><br>&nbsp;&nbsp; IEntityQuery&lt;EmployeeTerritory&gt; search = EntityManager.EmployeeTerritories<br>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; .Where(et =&gt; et.Employee.Orders&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; .Where(o =&gt; o.Customer.CustomerID == 1));<br><br>"Show me all EmployeeTerritories for which any related Order's Customer is the one identified by ID=1." <br><br>I'm going to use a variable, custID to hold the ID value that I need to match:<br><br>&nbsp;&nbsp; IEntityQuery&lt;EmployeeTerritory&gt; search = EntityManager.EmployeeTerritories<br>&nbsp; &nbsp; &nbsp; &nbsp; .Where(et =&gt; et.Employee.Orders&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; .Where(o =&gt; o.Customer.CustomerID == custID));<br><br>(I need to do that because, in NorthwindIB, Customer.CustomerID is a Guid. But that's just an ancillary detail.)<br><br><br>On the above query I get the following compile time error (last part of query highlighted by Visual Studio):<br><br>&nbsp;&nbsp;&nbsp;&nbsp; <i>Cannot implicitly convert type '' to System.Collections.Generic.IEnumerable&lt;DomainModel.Order&gt;' to 'bool'.</i><br><br>If I've translated your query correctly, you should be getting that same error (with equivalent types).<br><br><br>So what is the problem?<br><br>Well, <i>LINQ expects a Where expression to evaluate to a boolean</i>; so it doesn't know what to do with the expression <br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; et =&gt; et.Employee.Orders.Where(o =&gt; o.Customer.CustomerID == custID)<br><br>which returns <i>a collection of Orders</i>. <br><br>It literally doesn't know what you're asking it to retrieve.<br><br><br>On the other hand, the following query works:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var empTerritoriesQuery = _mgr.EmployeeTerritories<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(et=&gt;et.Employee.Orders.Any(o=&gt;o.Customer.CustomerID == custID));<br><br>That's because the expression<br><br>&nbsp;&nbsp;&nbsp;&nbsp; et=&gt;et.Employee.Orders.Any(o=&gt;o.Customer.CustomerID == custID)<br><br>does evaluate to a boolean.<br><br>So I <i>think </i>that's what you need. Your equivalent would be<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IEntityQuery&lt;CustomerLocation&gt; search = _mgr.CustomerLocations<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(cl=&gt;cl.Territory.OperationsTerritories.Any(ot=&gt;ot.Operation.OperationID == opID));<br><br><br><br>]]>
   </description>
   <pubDate>Mon, 28 Dec 2009 11:52:04 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5993#5993</guid>
  </item> 
  <item>
   <title>Joins : Greg, sorry but I am still having...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5992#5992</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=429" rel="nofollow">mbevins1</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 28-Dec-2009 at 4:53am<br /><br />Greg, sorry but I am still having problems with this.&nbsp; In your examle, you go from Product to Supplier to city.&nbsp; I can not do that in my query.&nbsp; When I get to operation territories, is ask for another where clause since it is a related entity list.&nbsp; I am guessing you can only have one supplier where I can have multiple operation territories. <DIV>&nbsp;</DIV><DIV>In the second where clause, I tried adding the build contains expression (in clause) and I get&nbsp;an error:</DIV><DIV>&nbsp;</DIV><DIV>IEntityQuery&lt;CustomerLocation&gt; search = EntityManager.CustomerLocations.Where(<BR>cl =&gt; cl.Territory.OperationTerritories.Where(<BR>Helper.BuildContainsExpression&lt;OperationTerritory, int&gt;<BR>(ot =&gt; ot.Operation.OperationID, CommonUser.CurrentUserOperationIDs)));</DIV><DIV>&nbsp;</DIV><DIV>The type arguments for method 'System.Linq.Enumerable.Where&lt;TSource&gt;(System.Collections.Generic.IEnumerable&lt;TSource&gt;, System.Func&lt;TSource,bool&gt;)' cannot be inferred from the usage. Try specifying the type arguments explicitly.</DIV><DIV>&nbsp;</DIV><DIV>I even tried it without the BuildContainsExpression but I can not figure it out because it is looking for an = somewhere but i cannot seem to figure out how to add it.</DIV><DIV>&nbsp;</DIV><DIV>IEntityQuery&lt;CustomerLocation&gt; search =<BR>EntityManager.CustomerLocations.Where(cl =&gt; cl.Territory.OperationTerritories.Where(ot =&gt; ot.Operation.OperationID == 1));</DIV><DIV>&nbsp;</DIV><DIV>I am still do not understand how I can do this using "method syntax"?&nbsp; Using my tables,&nbsp;can you help me build what you beleive the syntax should be?</DIV>]]>
   </description>
   <pubDate>Mon, 28 Dec 2009 04:53:20 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5992#5992</guid>
  </item> 
  <item>
   <title>Joins : Greg, I think I finally understand...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5990#5990</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=429" rel="nofollow">mbevins1</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 26-Dec-2009 at 5:28am<br /><br /><P>Greg, I think I finally understand now.&nbsp; Not to make excusses for my mindlessness but I have a one month old at home and haven't been getting a whole lot of sleep.&nbsp; Now that I have gotten a little sleep it makes since now why I wouldn't need to use joins.&nbsp; That is how I got it to work using normal sql and was on a one track mind thinking that was the only way.&nbsp; Thanks for pointing me in the right direction.</P><P>Happy Holidays to you too.</P><P>Mike</P>]]>
   </description>
   <pubDate>Sat, 26 Dec 2009 05:28:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5990#5990</guid>
  </item> 
  <item>
   <title>Joins : Mike, my sample queries access...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5988#5988</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 24-Dec-2009 at 12:41pm<br /><br />Mike, my sample queries access two tables: OrderDetails and Product. The join is implicit. I could easily make it three; e.g., <br><br>&nbsp; IEntityQuery&lt;OrderDetail&gt; search3 = <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _mgr.OrderDetails.Where(od =&gt; od.Product.Supplier.City == "Vancouver");<br><br>which would get me all the OrderDetails that refer to Products whose Suppliers are in Vancouver. If I had something else related to Supplier I could extend to four tables, and on out to however far the relationships reach.<br><br>You're doing the same thing, unless I'm completely out to lunch (which I will not say has never happened). You want customers subject to a condition on a related entity. It doesn't matter if the related entity is one step away or 16, as long as there exists a chain of relationships. You can walk the property path.<br><br>  In any event, it's not DevForce that's at issue here, it's LINQ to Entities. Since joins are supported, you should be able to write a query with joins if you want to, and still use the PredicateBuilder to create the part that compensates for the non-support of <i>In </i>in LINQ to Entities. I just never find the need for joins myself, and in fact rarely use query syntax (as opposed to method syntax) for my queries, so I'm just not very good at doing them that way.<br><br>Happy holidays!<br><br><br>]]>
   </description>
   <pubDate>Thu, 24 Dec 2009 12:41:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5988#5988</guid>
  </item> 
  <item>
   <title>Joins : Actually, I was wrong, there are...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5985#5985</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=429" rel="nofollow">mbevins1</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 23-Dec-2009 at 3:53pm<br /><br />Actually, I was wrong, there are 4 tables.<DIV>&nbsp;</DIV><DIV>CustomerLocation--&gt;Territory--&gt;OperationTerritory--&gt;Operation</DIV><DIV>&nbsp;</DIV><DIV>I need to get all customers that are part of an operation.</DIV><DIV>&nbsp;</DIV><DIV>A customer is part of a territory (customerlocation.territoryid) then the operationterritory contains which territories an operation is part of.&nbsp; In order to query this, the query needs to create joins.&nbsp; It appears that deforce supports joins (.Join&lt;&gt;) however I can not figure it out.</DIV>]]>
   </description>
   <pubDate>Wed, 23 Dec 2009 15:53:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5985#5985</guid>
  </item> 
  <item>
   <title>Joins : Please read my original post,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5984#5984</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=429" rel="nofollow">mbevins1</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 23-Dec-2009 at 3:14pm<br /><br />Please read my original post, these are nothing like my query.  My query has 3 tables that must be joined.  Customerlocation, operationterritory and operation.  A customer is part of a territory, we need to pull all customers that are part of an operation so the must be joined.]]>
   </description>
   <pubDate>Wed, 23 Dec 2009 15:14:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5984#5984</guid>
  </item> 
  <item>
   <title>Joins : You don&amp;#039;t need a join. The...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5983#5983</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 23-Dec-2009 at 2:44pm<br /><br />You don't need a join. The following three queries return the same results:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IEntityQuery&lt;OrderDetail&gt; search =<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from anOrderDetail in _mgr.OrderDetails<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; join aProduct in _mgr.Products<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on anOrderDetail.ProductID equals aProduct.ProductID<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where aProduct.UnitPrice &gt; 50<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select anOrderDetail;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IEntityQuery&lt;OrderDetail&gt; search2 =<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from anOrderDetail in _mgr.OrderDetails<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where anOrderDetail.Product.UnitPrice &gt; 50<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select anOrderDetail;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IEntityQuery&lt;OrderDetail&gt; search3 = <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _mgr.OrderDetails.Where(od =&gt; od.Product.UnitPrice &gt; 50);<br><br><span style="font-size:10px"><br /><br />Edited by GregD - 23-Dec-2009 at 2:47pm</span>]]>
   </description>
   <pubDate>Wed, 23 Dec 2009 14:44:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5983#5983</guid>
  </item> 
  <item>
   <title>Joins : Yes, I have seen that thread but...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5982#5982</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=429" rel="nofollow">mbevins1</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 23-Dec-2009 at 10:49am<br /><br /><P>Yes, I have seen that thread but how do you use it with the query above that has a join statement?&nbsp; </P>]]>
   </description>
   <pubDate>Wed, 23 Dec 2009 10:49:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5982#5982</guid>
  </item> 
  <item>
   <title>Joins : This thread describes a work-around...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5981#5981</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 23-Dec-2009 at 10:45am<br /><br />This thread describes a work-around for LINQ to Entities' non-support of IN:<br><br><a href="http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/thread/095745fe-dcf0-4142-b684-b7e4a1ab59f0/" target="_blank">http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/thread/095745fe-dcf0-4142-b684-b7e4a1ab59f0/</a><br><br><font color="#ff0000">*** BUT *** .</font>..before you get too absorbed in that, see this thread:<br><br><a href="forum_posts.asp?TID=1462&amp;PID=5980#5980" target="_blank">http://www.ideablade.com/forum/forum_posts.asp?TID=1462&amp;PID=5980#5980</a><br><br>and the section "The DevForce Predicate Builder" in the <i>Business Object Persistence </i>topic document in the Learning Resources. <br><br><br>]]>
   </description>
   <pubDate>Wed, 23 Dec 2009 10:45:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5981#5981</guid>
  </item> 
  <item>
   <title>Joins : Do you have an example on how...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5955#5955</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=429" rel="nofollow">mbevins1</a><br /><strong>Subject:</strong> 1591<br /><strong>Posted:</strong> 18-Dec-2009 at 4:35am<br /><br />Do you have an example on how to use Joins.&nbsp; For example:<DIV>&nbsp;</DIV><DIV>IEntityQuery&lt;CustomerLocation&gt; search = EntityManager.CustomerLocations;<BR><strong>search = search.Join&lt;OperationTerritory&gt; ... This is where I am stuck.</strong></DIV><DIV><BR>My Linq would look something like this but it will not work because of the<strong> in</strong> statement</DIV><DIV>&nbsp;</DIV><DIV>IEntityQuery&lt;CustomerLocation&gt; search = (from customerLocation in EntityManager.CustomerLocations<BR>join operationTerritory in EntityManager.OperationTerritories on customerLocation.Territory.TerritoryID equals operationTerritory.Territory.TerritoryID<BR>where operationTerritory.Operation.OperationID IN (0,1,2)<BR>select customerLocation);</DIV><DIV><FONT color=#2b91af size=2><FONT color=#2b91af size=2><P></FONT></FONT><FONT size=2>&nbsp;</P></FONT></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 18 Dec 2009 04:35:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1591&amp;PID=5955#5955</guid>
  </item> 
 </channel>
</rss>