title: Entity framework DbContext update value without query and by foreign key
body: <p>I have  a method for updating some tables. For update I need get first of <code>TestProcess</code>, but I don't like that. How can I update <code>TestProcess</code> without <code>select(firstOrDefault)</code> operation, used only for the update operation?</p>
  
  <p>Example of method:</p>
  
  <pre><code>public void UpdateTestProcess(int id, string updateID)
  {
      using (TestEntities context = new TestEntities())
                  {
                      TestProcess pr = context.TestProcess.FirstOrDefault(x =&gt; x.MyID == id);
                      pr.UpdateID = updateID;             
  
                      context.TestProcess.Attach(pr);
                      context.ObjectStateManager.ChangeObjectState(pr, EntityState.Modified);
                      context.SaveChanges();
                 }
  }
  </code></pre>