title: Retrieve single Entity Framework entities using a LINQ query or GetObjectKey?
body: <p>It looks like GetObjectKey has the benefit of searching for existing, instantiated objects, and THEN the data store.  However, it also seems like you lose some of the strong typing, and need to cast your resulting object:</p>
  
  <p>GetObjectKey</p>
  
  <pre><code>int customerID = 1;
  EntityKey key = new EntityKey("MyEntities.Customers", "CustomerID", customerID);
  Customer customer = context.GetObjectByKey(key) as Customer;
  </code></pre>
  
  <p>vs. LINQ</p>
  
  <pre><code>int customerID = 1;
  Customer customer = (from c in context.Customers 
                       where c.CustomerID = customerID
                       select c).FirstOrDefault();
  </code></pre>
  
  <p>Personally, I prefer the latter method, because of the typing.  Also, your DAL will be fairly uniform with all of the Get methods being queries, although that's just a personal preference.</p>
  
  <p>What do you boys and girls use?</p>