Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, so this isn't as pretty as the lambda expressions and I'm still a little fuzzy on what exactly the where clause needs to be since PointsName can't be Level and Buy Price at the same time, but I needed to start the conversation somewhere. I'm guessing that you'll need to do 2 joins on the points table but since you know your setup better than I, I'm guessing you'll be able to take this and modify it as needed. Let me know what I'm missing...</p> <pre><code>var items = (From items in context.InventoryItems join itemPoints in context.InventoryItemPoints on items.InventoryItemID equals itemPoints.InventoryItemID join points in context.Points on itemPoints.pointsID equals points.pointsID where (points.pointsName == "Level" &amp;&amp; itemPoints.pointsValue == maxStoreLevel) &amp;&amp; points.pointsName == "Buy Price" select items).Distinct(); </code></pre> <p>I knew the original wouldn't return rows as there was no way for the points name to have both values but based off your subsequent update, I think what you need is:</p> <pre><code>var items = (From items in context.InventoryItems join levelItemPoints in context.InventoryItemPoints on items.InventoryItemID equals levelItemPoints.InventoryItemID join levelPoints in context.Points on levelItemPoints.pointsID equals levelPoints.pointsID join priceItemPoints in context.InventoryItemPoints on items.InventoryItemID equals priceItemPoints.InventoryItemID join pricePoints in context.Points on priceItemPoints.pointsID equals pricePoints.pointsID where (levelPoints.pointsName == "Level" &amp;&amp; levelItemPoints.pointsValue == maxStoreLevel) &amp;&amp; pricePoints.pointsName == "Buy Price" select items).Distinct(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload