title: .NET Core Entity Framework Fluent api error, DateTime properties have text as column type
body: <p>In my model namespace, I have different model classes. I have <code>DateTime</code> fields in my different classes. When I run </p>
  
  <pre><code>dotnet ef migrations add InitialCreate 
  </code></pre>
  
  <p>without problem, it adds a migration and I am able to update the database too.</p>
  
  <p>When I looked up my <code>initialCommit.Designer.cs</code>, I saw that all of my <code>DateTime</code> properties have column type text.</p>
  
  <p>Like this:</p>
  
  <pre><code>namespace myapp.API.Models
  {
      public class User
      {
          public int Id { get; set; }
          public string UserName { get; set; }
          public string Gender { get; set; }
          public DateTime BirthDate { get; set; }
          public string KnownAs { get; set; }
          public DateTime CreatedOn { get; set; }
          public DateTime LastActive { get; set; }
          ..
      }
  }
  
  namespace myapp.API.Models
  {
      public class Photo
      {
          public int Id { get; set; }
          public string Url { get; set; }
          public string Description { get; set; }
          public DateTime DateAdded { get; set; }
          public bool IsMain { get; set; }
          public string PublicId  { get; set; }
          public User User { get; set; }
          public int UserId { get; set; }
      }
  }
  
  namespace myapp.API.Migrations
  {
      [DbContext(typeof(DataContext))]
      [Migration("20200206201625_initialCommit")]
      partial class initialCommit
      {
          protected override void BuildTargetModel(ModelBuilder modelBuilder)
          {
  #pragma warning disable 612, 618
              modelBuilder
                  .HasAnnotation("ProductVersion", "3.1.1");
  
              modelBuilder.Entity("myapp.API.Models.Photo", b =&gt;
                  {
                      b.Property&lt;int&gt;("Id")
                          .ValueGeneratedOnAdd()
                          .HasColumnType("INTEGER");
  
                      b.Property&lt;DateTime&gt;("DateAdded")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("Description")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;bool&gt;("IsMain")
                          .HasColumnType("INTEGER");
  
                      b.Property&lt;string&gt;("PublicId")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("Url")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;int&gt;("UserId")
                          .HasColumnType("INTEGER");
  
                      b.HasKey("Id");
  
                      b.HasIndex("UserId");
  
                      b.ToTable("Photos");
                  });
  
              modelBuilder.Entity("myapp.API.Models.User", b =&gt;
                  {
                      b.Property&lt;int&gt;("Id")
                          .ValueGeneratedOnAdd()
                          .HasColumnType("INTEGER");
  
                      b.Property&lt;DateTime&gt;("BirthDate")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("City")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("Country")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;DateTime&gt;("CreatedOn")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("Gender")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("Interests")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("Introduction")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("KnownAs")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;DateTime&gt;("LastActive")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("LookingFor")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;byte[]&gt;("PasswordHash")
                          .HasColumnType("BLOB");
  
                      b.Property&lt;byte[]&gt;("PasswordSalt")
                          .HasColumnType("BLOB");
  
                      b.Property&lt;string&gt;("UserName")
                          .HasColumnType("TEXT");
  
                      b.HasKey("Id");
  
                      b.ToTable("Users");
                  });
  
              modelBuilder.Entity("myapp.API.Models.Value", b =&gt;
                  {
                      b.Property&lt;int&gt;("Id")
                          .ValueGeneratedOnAdd()
                          .HasColumnType("INTEGER");
  
                      b.Property&lt;string&gt;("Name")
                          .HasColumnType("TEXT");
  
                      b.Property&lt;string&gt;("Type")
                          .HasColumnType("TEXT");
  
                      b.HasKey("Id");
  
                      b.ToTable("Values");
                  });
  
              modelBuilder.Entity("myapp.API.Models.Photo", b =&gt;
                  {
                      b.HasOne("myapp.API.Models.User", "User")
                          .WithMany("Photos")
                          .HasForeignKey("UserId")
                          .OnDelete(DeleteBehavior.Cascade)
                          .IsRequired();
                  });
  #pragma warning restore 612, 618
          }
      }
  }
  </code></pre>
  
  <p>As you can see, all of my <code>DateTime</code> fields are defined like this :</p>
  
  <pre><code>b.Property&lt;DateTime&gt;("DateAdded").HasColumnType("TEXT");
  </code></pre>