title: Comparing large list of objects
body: <p>I have a form that contains a list of objects that are all updated at once.  In the controller, a nested loop compares each model to the other models so it can determine which objects have been updated and which are new.</p>
  
  <pre><code>foreach(var x in formObject)
  {
      foreach(var y in dbObject)
      {
          if(x.id == y.id)
          {
               //compare each property and notify user of change if different
          }
      }
  }
  </code></pre>
  
  <p>This takes a huge amount of time considering the large number of objects and how slow the servers are.</p>
  
  <p>Is there a better practice for doing this?  Some way of determining which objects have been updated before looping through all?  Or a more efficient loop?</p>