title: How to "Load" or "Get" a domain in Entity Framework?
body: <p>In nhibernate you can use "Load" or "Get" to take an "Id" and load it into a domain model. How do you do something like that in EF?</p>
  
  <p>I have some "Ids" that I am sending from the client to my server. I want take the new item and associate them with the new item without having to actually getting them from the db.</p>
  
  <p>In nhibernate I would do something like this</p>
  
  <pre><code>public void MyMethod(int brandId, string productName)
  {
     Product p = new Product()
     {
          Name = productName,
          Brand = session.Load&lt;Brand&gt;(brandId)
     };
  
     session.Save(p);
     session.Commit();
  }
  </code></pre>