title: Entity Framework 6 Code First default datetime value on insert
body: <p>When I'm saving changes to the database, I'm running into the following exception:</p>
  
  <pre><code>Cannot insert the value NULL into column 'Registered', table
  'EIT.Enterprise.KMS.dbo.LicenseEntry'; column does not allow nulls.
  INSERT fails. The statement has been terminated.
  </code></pre>
  
  <p>The related code first model property looks like this:</p>
  
  <pre><code>[DatabaseGenerated(DatabaseGeneratedOption.Identity), DataMember]
  public DateTime         Registered          { get; private set; }
  </code></pre>
  
  <p>... and here's why I'm confused: As far as I know, by providing the annotation <code>[DatabaseGenerated(DatabaseGeneratedOption.Identity)</code> I'm ordering Entity Framework to auto-generate the field (in this case: Only once at creation time.)</p>
  
  <p>So I'm expecting to have a non-nullable (required) field, without the possibility to alter the field manually where EF is taking care of.</p>
  
  <p>What am I doing wrong?</p>
  
  <hr>
  
  <p>Notes:</p>
  
  <ol>
  <li>I don't want to use Fluent-API, as I want to use POCOs.</li>
  <li>The property <code>defaultValueSql</code> is also not an option, because I need to rely database independed for this project (e.g. for <code>GETDATE()</code>).</li>
  <li>I'm using Entity Framework 6 alpha 3, Code First.</li>
  </ol>