title: Lookup using Entity Framework
body: <p>I am trying to do lookup cross 2 tables using Entity Framework unfortunately I couldn't find way but I do have sql query which does what I want</p>
  
  <p>SQL Query </p>
  
  <pre><code>select top(1) p1.Percentage
  from LookupTable p1 , [lookupTablePerUnit] p2
  where p2.[LookupValue] &amp;lt;= @Value1  and p1.ID=p2.[LookupID]
  order BY pr.range DESC
  </code></pre>
  
  <p>if @Value1= 6 then The result = 52</p>
  
  <p>Here is a screenshot of two tables (lookupTable &amp;&amp; LookTablePerUnit) using this query   </p>
  
  <pre><code>(SELECT * FROM [DB].[dbo].[lookupTablePerUnit] p1 , [DB].[dbo].[LookupTable] p2
  where p1.LookupTableID = p2.ID)
  </code></pre>
  
  <p><a href="http://s15.postimage.org/m80zvn4mx/Captur2e.png" rel="nofollow noreferrer">http://s15.postimage.org/m80zvn4mx/Captur2e.png</a></p>