title: What .NET data model can let me forget about IDs?
body: <p>I'd like to take advantage of .NET's data frameworks, but I'm a bit confused about how they work, and I'm not sure if what I want is possible. (I've done much of this with PHP frameworks, so I should hope .NET can do the same!) In short, I'd like my business logic to be database-agnostic, and in some sense, agnostic of the fact that it's a database at all.</p>
  
  <p>Queries like this irritate me:</p>
  
  <pre><code>var productNames =
      from p in context.Products
      where seller.SellerID == mySeller.SellerID
      select p.Name;
  </code></pre>
  
  <p>Instead, I'd like to do:</p>
  
  <pre><code>var productNames =
      from p in context.Products
      where seller == mySeller
      select p.Name;
  </code></pre>
  
  <p>In essence, I want my business logic to not <em>care</em> about the ID mappings. Partly, this is because in a few tables, IDs have real meaning. (Some of the tables I'm working with are imported from another application domain, and I need to be able to work with those IDs directly, but for my own types the IDs are incidental.)</p>
  
  <p>It's a minor point in the example, but in general, I want to be able to work entirely in the world of objects and more or less forget about the realities of the underlying database. Is this just a matter of defining equivalence operators for my classes?</p>
  
  <p>In summary: What .NET data framework gives me the cleanest database abstraction to the world of objects?</p>