title: Entity Framework Views and Linq .Where
body: <p>I have a very small entity framework setup containing only a few related classes/tables and a view. I need to be able to pull a specific record from this view, namely, I need to be able to grab the record that meets two criteria, it has a specific <strong><em>ProfileID</em></strong> and a specific <strong><em>QuoteID</em></strong>.</p>
  
  <p>This line is what's causing the problem:</p>
  
  <pre><code>TWProfileUpchargeTotal upchargeTotals = _context.TWProfileUpchargeTotals.Where(p =&gt; p.Profileid == profile.id &amp;&amp; p.quoteid == _quote.quoteid).First();
  </code></pre>
  
  <p>I'm looping through the profiles I know about and getting their information from the view, so profile.id changes each time.</p>
  
  <p>The first time this code executes it gets the correct record from the view.
  The second and third (and presumably beyond that) time it executes, it retrieves the exact same record.</p>
  
  <p>Any idea why or what I'm doing wrong here?</p>
  
  <p>Thanks, in advance.</p>