title: MVC AddObject Create multiple records
body: <p>I have a list which contains multiple records. I like to use the AddObject to create those records but what is happening is that it creates just the last record in the list.</p>
  
  <p>Here is the code  </p>
  
  <pre><code>    foreach (var item in invlist) {
  
           invmodel.tblrec.FirstName = item.FirstName;
           invmodel.tblrec.LastName = item.LastName;
  
           db.tblRec.AddObject(invmodel.tblrec);                         
  
       }
  
       db.SaveChanges();
  </code></pre>