title: Code First, set GetDate() on DateTime2 field
body: <p>I've followed the examples like accepted here: <a href="https://stackoverflow.com/questions/8594431/possible-to-default-datetime-field-to-getdate-with-entity-framework-migrations">Possible to default DateTime field to GETDATE() with Entity Framework Migrations?</a></p>
  
  <p>In Sql server, the "Default Binding or Value" is now getting set to ('1900-01-01T00:00:00.000'), but not to GetDate() as I would expect. </p>
  
  <pre><code>public partial class InitialCreate : DbMigration
  {
      public override void Up()
      {
          AddColumn("dbo.UserWordsModels", "DateAdded", c =&gt; c.DateTime(defaultValueSql: "GETDATE()"));
  
      }
  
      public override void Down()
      {
          DropColumn("dbo.UserWordsModels", "DateAdded");
      }
  }
  </code></pre>
  
  <p>In the Model:</p>
  
  <pre><code>[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
      public DateTime DateAdded { get; set; }
  </code></pre>
  
  <p>One thing I may have different is I set this so all DateTime fields are DateTime2</p>
  
  <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          modelBuilder.Properties&lt;DateTime&gt;().Configure(c =&gt; c.HasColumnType("datetime2"));}
  </code></pre>