title: EF Core migration for DateTime to DateTimeOffset
body: <p>I am looking to create a migration for a series of objects which currently use <code>DateTime</code> properties and translate them into <code>DateTimeOffset</code> properties instead. I've stripped most of them out of this example but they were similar:</p>
  
  <pre><code>public partial class DatetimeOffset : Migration
  {
      protected override void Up(MigrationBuilder migrationBuilder)
      {
          migrationBuilder.AlterColumn&lt;Message&gt;(nameof(Message.SendingDate), nameof(Message), nameof(DateTimeOffset));
      }
  
      protected override void Down(MigrationBuilder migrationBuilder)
      {
          migrationBuilder.AlterColumn&lt;Message&gt;(nameof(Message.SendingDate), nameof(Message), "datetime");
      }
  }
  </code></pre>
  
  <p>For these purposes just assume that <code>Message</code> looks like this:</p>
  
  <pre><code>public class Message {
      public DateTime SendingDate { get; set; }
  }
  </code></pre>
  
  <p>My upgrade works just fine, however, the downgrade doesn't since it's a lossy conversion between DateTimeOffset and DateTime. What is a way to cast this? I don't care about precision loss.</p>
  
  <p>I am using .NET Core 2.2 and EF Core 2.2.</p>