title: How to update entire Object in Linq2SQL
body: <p>Lets suppose I have a method like that in MVC</p>
  
  <pre><code>public void UpdateUser(User user)
  {
    DataContext db = new DataContext();
    User u = db.Users.First(t=&gt;t.UserId = user.UserId);
    u.Name = user.Name;
    u.LastName = user.LastName;
    db.SubmitChanges();
  }
  </code></pre>
  
  <p>If we start thinking that we have properties more than Name and LastName, this process is getting cumbersome and I wonder whether there is way to easily reconcile these two objects and update it quickly.</p>
  
  <p>Maybe something like this:</p>
  
  <pre><code>public void UpdateUser(User user)
  {
    DataContext db = new DataContext();
    User u = db.Users.First(t=&gt;t.UserId = user.UserId);
    u.MergeWith(user);
    db.SubmitChanges();
  }
  </code></pre>
  
  <p>I think that would much easier.</p>