title: Real example of TryUpdateModel, ASP .NET MVC 3
body: <p>I can't understand, how to use TryUpdateModel and save the MVC architecture at the same time.</p>
  
  <p>If I am not mistaken, work with datacontexts must be in the Model. So, such code</p>
  
  <pre><code>var db=new TestEverybody();//it is class, which was generated by EntityFramework 
  var currentTesting=db.Testing.(t =&gt; t.id == id).First();
  </code></pre>
  
  <p>must be situated in the Model, not in the Controller, mustn't it?</p>
  
  <p>But the ussual examples of TryUpdateModel usage is following:</p>
  
  <pre><code>    public ActionResult Edit(Testing obj)//Testing collection
      {
          var db = new TestEverybody();
          var currentTesting=db.Testing.(t =&gt; t.id == obj.id).First();
          TryUpdateModel(currentTesting);
          db.SaveChanges();            
          return RedirectToAction("Index");
      }
  </code></pre>
  
  <p>Doesn't this way break the MVC architecture? We work with database in the controller, not in the special Model class.</p>
  
  <p>So, what is the best way to use TryUpdateModel in a real project?</p>