title: Problems adding object to database in Entity Framework
body: <p>I have the following code trying to add an object to the database:</p>
  
  <pre><code>public static void saveAudit(List&lt;AUDIT&gt; audit)
  {
   Entities dao = new Entities();
  
   foreach (CMUAUDIT a in audit)
   {
      dao.CMUAUDITs.AddObject(a);
   }
  
   dao.SaveChanges();
  }
  </code></pre>
  
  <p>However I get the error message:</p>
  
  <blockquote>
    <p>"...does not contain a definition for 'AddObject' and no extension
    method 'AddObject' accepting a first argument of type 'System.Data.Entity.DbSet' could be found (are you missing a using directive or an assembly reference?)"</p>
  </blockquote>
  
  <p>I've done some searching, and there is mention of the primary key having something to do with it. Any suggestions?</p>
  
  <p>I'm using a DB2 database if that makes any difference?</p>