title: Updating a nullable DateTime field as null results in default DateTime value (0001-01-01 00:00:00.0000000)
body: <p>I'm using ASP.NET Boilerplate MVC (not Core) template in my project, which uses EF6 as ORM. Database is SQL Server Express.</p>
  <p>Here's my entity object (ignoring non-related properties):</p>
  <pre><code>public class Asset : AggregateRoot&lt;long&gt;
  {
      [DataType(DataType.DateTime)]
      public DateTime? LastControlTime { get; set; }
  }
  </code></pre>
  <p>When I create a new Asset, this field appropriately created as NULL. So, everything works as intented at first. But when I try to update an object with a simple service call, it screws up.</p>
  <p>Here's the method in the application service class:</p>
  <pre><code>public void ResetLastControlTime (EntityDto&lt;long&gt; input)
  {
      var asset = Repository.Get(input.Id);
      asset.LastControlTime = default(DateTime?);
  }
  </code></pre>
  <p>This should reset that field to null. I also tried <code>asset.LastControlTime = null;</code>. But in the end  it's written &quot;0001-01-01 00:00:00.0000000&quot; to that field in the database. I have lots of places in code that I control for a null value so now I had to change tons of old files or I must find some way to reset that field to simply NULL.</p>
  <p>I checked similar questions here but cannot find an answer. All of them tells about nullable DateTime, which I already have. In SQL server table schema, Data Type is <code>datetime2(7)</code>, so I guess that's correct too. Oh and deleting the DataType annotation also didn't change anything.</p>
  <p>So what am I missing here? What should I check to find the issue?</p>