title: Creating complex XPQuery - LINQ to SQL with nested lists
body: <p>any hint on what's wrong with the below query?</p>
  
  <pre><code>return new ItemPricesViewModel()
              {
                  Source = (from o in XpoSession.Query&lt;PRICE&gt;()
                            select new ItemPriceViewModel()
                            {
                                ID = o.ITEM_ID.ITEM_ID,
                                ItemCod = o.ITEM_ID.ITEM_COD,
                                ItemModifier = o.ITEM_MODIFIER_ID.ITEM_MODIFIER_COD,
                                ItemName = o.ITEM_ID.ITEM_COD,
                                ItemID = o.ITEM_ID.ITEM_ID,
                                ItemModifierID = o.ITEM_MODIFIER_ID.ITEM_MODIFIER_ID,
                                ItemPrices = (from d in o
                                                  where d.ITEM_ID.ITEM_ID == o.ITEM_ID.ITEM_ID &amp;&amp; d.ITEM_MODIFIER_ID.ITEM_MODIFIER_ID == o.ITEM_MODIFIER_ID.ITEM_MODIFIER_ID
                                                  select new Price()
                                                  {
                                                      ID = o.PRICE_ID,
                                                      PriceList = o.PRICELIST_ID.PRICELIST_,
                                                      Price = o.PRICE_
  
                                                  }).ToList()
                            }).ToList()
              };
  </code></pre>
  
  <ol>
  <li>o in subquery is in read and I got the message "Could not find an implementation of the query pattern for source type . 'Where' not found."</li>
  <li>I would like to have distinct ItemID, ItemModifier: should I create a custom IEqualityComparer to do it?</li>
  </ol>
  
  <p>Thank you!</p>