title: PetaPoco - How to turn off auto increment?
body: <p>I ran into this error when trying to do an insert:</p>
  
  <blockquote>
    <p>Cannot insert the value NULL into column 'Id'</p>
  </blockquote>
  
  <p>It turns out PetaPoco by default assumes the Id column is auto increment, so even if you provide a value it will attempt to insert null instead.  I found a bug ticket for the problem here: <a href="https://dnntracker.atlassian.net/browse/DNN-23217" rel="nofollow">https://dnntracker.atlassian.net/browse/DNN-23217</a>.</p>
  
  <p>I'm using PetaPoco's T4 template to generate my database classes.  I created a partial class an applied the data annotation to disable auto increment:</p>
  
  <pre><code>[PrimaryKey("Id", autoIncrement = false)]
  public partial class Blah : DatabaseDB.Record&lt;Database.Blah&gt;
  {
  }
  </code></pre>
  
  <p>However it seems to have no effect.  PetaPoco is still trying to insert null for the Id column when I am specifying an integer.</p>