title: Linq get last ID inserted
body: <p>I´m trying to do 2 linq insert queries. The second one needs the last inserted id value from the first query.</p>
  
  <p>How can I get the last_id_inserted (last_fich)?</p>
  
  <pre><code>db.CWC_FICHEIROS.Add(new CWC_FICHEIROS
  {
      idfiletype = newextID,
      filename = fileName,
      fileurl = fileName,
      fileordem = "AA001",
      filedate = System.DateTime.Now,
      fileact = true
   });
  last_fich = db.CWC_FICHEIROS.Max(item =&gt; item.id_file);
  
  db.CWC_FILESSUBCONTEUDOS.Add(new CWC_FILESSUBCONTEUDOS
  {
       idfile = last_fich,
       idsubconte = cwc_subconteudos.idcont,
       fscact = true
  });
  
  db.SaveChanges();
  </code></pre>
  
  <p>Like it is, <code>last_fich</code> gives me the id of the first row of <code>CWC_FICHEIROS</code>.</p>