Can i use daterange column and work with EF for PostgreSQL ,c#?How do I calculate someone's age in C#?Calculate relative time in C#What is the difference between String and string in C#?Hidden Features of C#?Calling the base constructor in C#Cast int to enum in C#How do you give a C# Auto-Property a default value?How do I enumerate an enum in C#?What are the correct version numbers for C#?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?

Why is there a large performance impact when looping over an array over 240 elements?

Loading military units into ships optimally, using backtracking

Lengthened voiced stops and the airstream through the nose

How can this older-style irrigation tee be replaced?

Apex more than 50 Queueble jobs

How can I decide if my homebrew item should require attunement?

What gave Harry Potter the idea of writing in Tom Riddle's diary?

Why did Gandalf use a sword against the Balrog?

Does fossil fuels use since 1990 account for half of all the fossil fuels used in history?

Email address etiquette - Which address should I use to contact professors?

Heat equation: Squiggly lines

Why does the standard fingering / strumming for a D maj chord leave out the 5th string?

What ability do tools use?

Plotting octahedron inside the sphere and sphere inside the cube

Submitting a new paper just after another was accepted by the same journal

Can "être sur" mean "to be about" ?

Is this n-speak?

How to divide item stack in MC PE?

Why is the result of ('b'+'a'+ + 'a' + 'a').toLowerCase() 'banana'?

A torrent of foreign terms

If a digital camera can be "hacked" in the ransomware sense, how best to protect it?

Do beef farmed pastures net remove carbon emissions?

How much maintenance time did it take to make an F4U Corsair ready for another flight?

Breadcrumb history decision



Can i use daterange column and work with EF for PostgreSQL ,c#?


How do I calculate someone's age in C#?Calculate relative time in C#What is the difference between String and string in C#?Hidden Features of C#?Calling the base constructor in C#Cast int to enum in C#How do you give a C# Auto-Property a default value?How do I enumerate an enum in C#?What are the correct version numbers for C#?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















Generally i have report data for some date range and i want to insert new, and delete old one for the same period.



I want to use column of type daterange in postgresql db.
I am using newest version of EF for postgre.
I want to be able to map my field to some property.
I want to be able select, remove and insert new based on this column.



I tried to map my context to :
public NpgsqlRange month_year get; set;
but got exception: “column "month_year" is of type daterange but expression is of type tsrange” – I understand that it is happening because the mapping works that way: NpgsqlRange => tsrange



I tried to use:
NpgsqlRange
but got next exception:
The property 'DBTable1.DateRangeNoda' is of type 'NpgsqlRange' which is not supported by current database provider – but shouldn’t this be already working ?
So my question is: Is there way to work in .net core using EF with column of type daterange?How?



using (var context = new postgresContext())

var d = new DBTable1()Text = "aaa" ;
d.DateRange1 = new NpgsqlRange<DateTime>(DateTime.Today, DateTime.Today);

//d.DateRangeNoda = new NpgsqlRange<LocalDate>
// (LocalDate.FromDateTime(DateTime.Today),
// LocalDate.FromDateTime(DateTime.Today) );
//efNpgsqlDate> not supported by provider

context.dbTable1.Add(d);

context.SaveChanges();


public partial class DBTable1

[Column("id")]
public int Id get; set;

public NpgsqlRange<DateTime> DateRange0 get; set;

public NpgsqlRange<LocalDate> DateRangeNoda get; set;


protected override void OnModelCreating(ModelBuilder modelBuilder)

modelBuilder.Entity<DBTable1>(entity =>

entity.ToTable("test1");

entity.Property(e => e.DateRange1).HasColumnName("daterange1");

entity.Property(e => e.DateRangeNoda).HasColumnName("daterange");

);



For now i end up using date column with FirstOfTheRange date :(



Thank you for your help,










share|improve this question






























    1















    Generally i have report data for some date range and i want to insert new, and delete old one for the same period.



    I want to use column of type daterange in postgresql db.
    I am using newest version of EF for postgre.
    I want to be able to map my field to some property.
    I want to be able select, remove and insert new based on this column.



    I tried to map my context to :
    public NpgsqlRange month_year get; set;
    but got exception: “column "month_year" is of type daterange but expression is of type tsrange” – I understand that it is happening because the mapping works that way: NpgsqlRange => tsrange



    I tried to use:
    NpgsqlRange
    but got next exception:
    The property 'DBTable1.DateRangeNoda' is of type 'NpgsqlRange' which is not supported by current database provider – but shouldn’t this be already working ?
    So my question is: Is there way to work in .net core using EF with column of type daterange?How?



    using (var context = new postgresContext())

    var d = new DBTable1()Text = "aaa" ;
    d.DateRange1 = new NpgsqlRange<DateTime>(DateTime.Today, DateTime.Today);

    //d.DateRangeNoda = new NpgsqlRange<LocalDate>
    // (LocalDate.FromDateTime(DateTime.Today),
    // LocalDate.FromDateTime(DateTime.Today) );
    //efNpgsqlDate> not supported by provider

    context.dbTable1.Add(d);

    context.SaveChanges();


    public partial class DBTable1

    [Column("id")]
    public int Id get; set;

    public NpgsqlRange<DateTime> DateRange0 get; set;

    public NpgsqlRange<LocalDate> DateRangeNoda get; set;


    protected override void OnModelCreating(ModelBuilder modelBuilder)

    modelBuilder.Entity<DBTable1>(entity =>

    entity.ToTable("test1");

    entity.Property(e => e.DateRange1).HasColumnName("daterange1");

    entity.Property(e => e.DateRangeNoda).HasColumnName("daterange");

    );



    For now i end up using date column with FirstOfTheRange date :(



    Thank you for your help,










    share|improve this question


























      1












      1








      1


      1






      Generally i have report data for some date range and i want to insert new, and delete old one for the same period.



      I want to use column of type daterange in postgresql db.
      I am using newest version of EF for postgre.
      I want to be able to map my field to some property.
      I want to be able select, remove and insert new based on this column.



      I tried to map my context to :
      public NpgsqlRange month_year get; set;
      but got exception: “column "month_year" is of type daterange but expression is of type tsrange” – I understand that it is happening because the mapping works that way: NpgsqlRange => tsrange



      I tried to use:
      NpgsqlRange
      but got next exception:
      The property 'DBTable1.DateRangeNoda' is of type 'NpgsqlRange' which is not supported by current database provider – but shouldn’t this be already working ?
      So my question is: Is there way to work in .net core using EF with column of type daterange?How?



      using (var context = new postgresContext())

      var d = new DBTable1()Text = "aaa" ;
      d.DateRange1 = new NpgsqlRange<DateTime>(DateTime.Today, DateTime.Today);

      //d.DateRangeNoda = new NpgsqlRange<LocalDate>
      // (LocalDate.FromDateTime(DateTime.Today),
      // LocalDate.FromDateTime(DateTime.Today) );
      //efNpgsqlDate> not supported by provider

      context.dbTable1.Add(d);

      context.SaveChanges();


      public partial class DBTable1

      [Column("id")]
      public int Id get; set;

      public NpgsqlRange<DateTime> DateRange0 get; set;

      public NpgsqlRange<LocalDate> DateRangeNoda get; set;


      protected override void OnModelCreating(ModelBuilder modelBuilder)

      modelBuilder.Entity<DBTable1>(entity =>

      entity.ToTable("test1");

      entity.Property(e => e.DateRange1).HasColumnName("daterange1");

      entity.Property(e => e.DateRangeNoda).HasColumnName("daterange");

      );



      For now i end up using date column with FirstOfTheRange date :(



      Thank you for your help,










      share|improve this question














      Generally i have report data for some date range and i want to insert new, and delete old one for the same period.



      I want to use column of type daterange in postgresql db.
      I am using newest version of EF for postgre.
      I want to be able to map my field to some property.
      I want to be able select, remove and insert new based on this column.



      I tried to map my context to :
      public NpgsqlRange month_year get; set;
      but got exception: “column "month_year" is of type daterange but expression is of type tsrange” – I understand that it is happening because the mapping works that way: NpgsqlRange => tsrange



      I tried to use:
      NpgsqlRange
      but got next exception:
      The property 'DBTable1.DateRangeNoda' is of type 'NpgsqlRange' which is not supported by current database provider – but shouldn’t this be already working ?
      So my question is: Is there way to work in .net core using EF with column of type daterange?How?



      using (var context = new postgresContext())

      var d = new DBTable1()Text = "aaa" ;
      d.DateRange1 = new NpgsqlRange<DateTime>(DateTime.Today, DateTime.Today);

      //d.DateRangeNoda = new NpgsqlRange<LocalDate>
      // (LocalDate.FromDateTime(DateTime.Today),
      // LocalDate.FromDateTime(DateTime.Today) );
      //efNpgsqlDate> not supported by provider

      context.dbTable1.Add(d);

      context.SaveChanges();


      public partial class DBTable1

      [Column("id")]
      public int Id get; set;

      public NpgsqlRange<DateTime> DateRange0 get; set;

      public NpgsqlRange<LocalDate> DateRangeNoda get; set;


      protected override void OnModelCreating(ModelBuilder modelBuilder)

      modelBuilder.Entity<DBTable1>(entity =>

      entity.ToTable("test1");

      entity.Property(e => e.DateRange1).HasColumnName("daterange1");

      entity.Property(e => e.DateRangeNoda).HasColumnName("daterange");

      );



      For now i end up using date column with FirstOfTheRange date :(



      Thank you for your help,







      c# entity-framework npgsql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 8:59









      MarinaMarina

      61 bronze badge




      61 bronze badge

























          2 Answers
          2






          active

          oldest

          votes


















          1














          There seems to be a bit of confusion in your code sample above - you are accessing property DateRange1 whereas the DBTable1 class seems to contain DateRange0.



          Npgsql supports two ways of interacting with date/time types: the built-in BCL types (e.g. DateTime) and the NodaTime library. The built-in DateTime type is supported, but is mapped by default to PostgreSQL timestamp rather than date, since it has a time components. Therefore, a property of type NpgsqlRange<DateTime> will cause Npgsql to create a tsrange column (range of timestamp), rather than a daterange). It's possible to explicitly specify daterange as the column type, but you will encounter some subtle problems with this (see this comment).



          If using NodaTime is OK, then things should work better, since NodaTime has a date-only type - LocalDate - so NpgsqlRange<LocalDate> automatically maps to daterange. To do this you will need to use the NodaTime plugin, as specified in the docs.



          Here's a full code sample for using a date range with NodaTime, including insertion and query:



          class Program

          static void Main(string[] args)

          using (var ctx = new BlogContext())

          ctx.Database.EnsureDeleted();
          ctx.Database.EnsureCreated();

          ctx.Blogs.Add(new Blog Duration = new NpgsqlRange<LocalDate>(new LocalDate(2011, 1, 1), new LocalDate(2011, 1, 3)) );
          ctx.SaveChanges();

          var x = ctx.Blogs.FirstOrDefault(b => b.Duration.Contains(new LocalDate(2011, 1, 2)));




          public class BlogContext : DbContext

          protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
          => optionsBuilder.UseNpgsql("<connection string>", o => o.UseNodaTime());

          public DbSet<Blog> Blogs get; set;


          public class Blog

          public int Id get; set;
          public NpgsqlRange<LocalDate> Duration get; set;






          share|improve this answer

























          • Thanks a lot. It is working now. My problem was using wrong package for Nodatime:<!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> <!--Good one --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />

            – Marina
            Apr 1 at 6:58



















          0














          Problem was using wrong package for NodaTime:



          <!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> 
          <!--Good one -->
          <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />





          share|improve this answer



























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55373227%2fcan-i-use-daterange-column-and-work-with-ef-for-postgresql-c%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            There seems to be a bit of confusion in your code sample above - you are accessing property DateRange1 whereas the DBTable1 class seems to contain DateRange0.



            Npgsql supports two ways of interacting with date/time types: the built-in BCL types (e.g. DateTime) and the NodaTime library. The built-in DateTime type is supported, but is mapped by default to PostgreSQL timestamp rather than date, since it has a time components. Therefore, a property of type NpgsqlRange<DateTime> will cause Npgsql to create a tsrange column (range of timestamp), rather than a daterange). It's possible to explicitly specify daterange as the column type, but you will encounter some subtle problems with this (see this comment).



            If using NodaTime is OK, then things should work better, since NodaTime has a date-only type - LocalDate - so NpgsqlRange<LocalDate> automatically maps to daterange. To do this you will need to use the NodaTime plugin, as specified in the docs.



            Here's a full code sample for using a date range with NodaTime, including insertion and query:



            class Program

            static void Main(string[] args)

            using (var ctx = new BlogContext())

            ctx.Database.EnsureDeleted();
            ctx.Database.EnsureCreated();

            ctx.Blogs.Add(new Blog Duration = new NpgsqlRange<LocalDate>(new LocalDate(2011, 1, 1), new LocalDate(2011, 1, 3)) );
            ctx.SaveChanges();

            var x = ctx.Blogs.FirstOrDefault(b => b.Duration.Contains(new LocalDate(2011, 1, 2)));




            public class BlogContext : DbContext

            protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
            => optionsBuilder.UseNpgsql("<connection string>", o => o.UseNodaTime());

            public DbSet<Blog> Blogs get; set;


            public class Blog

            public int Id get; set;
            public NpgsqlRange<LocalDate> Duration get; set;






            share|improve this answer

























            • Thanks a lot. It is working now. My problem was using wrong package for Nodatime:<!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> <!--Good one --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />

              – Marina
              Apr 1 at 6:58
















            1














            There seems to be a bit of confusion in your code sample above - you are accessing property DateRange1 whereas the DBTable1 class seems to contain DateRange0.



            Npgsql supports two ways of interacting with date/time types: the built-in BCL types (e.g. DateTime) and the NodaTime library. The built-in DateTime type is supported, but is mapped by default to PostgreSQL timestamp rather than date, since it has a time components. Therefore, a property of type NpgsqlRange<DateTime> will cause Npgsql to create a tsrange column (range of timestamp), rather than a daterange). It's possible to explicitly specify daterange as the column type, but you will encounter some subtle problems with this (see this comment).



            If using NodaTime is OK, then things should work better, since NodaTime has a date-only type - LocalDate - so NpgsqlRange<LocalDate> automatically maps to daterange. To do this you will need to use the NodaTime plugin, as specified in the docs.



            Here's a full code sample for using a date range with NodaTime, including insertion and query:



            class Program

            static void Main(string[] args)

            using (var ctx = new BlogContext())

            ctx.Database.EnsureDeleted();
            ctx.Database.EnsureCreated();

            ctx.Blogs.Add(new Blog Duration = new NpgsqlRange<LocalDate>(new LocalDate(2011, 1, 1), new LocalDate(2011, 1, 3)) );
            ctx.SaveChanges();

            var x = ctx.Blogs.FirstOrDefault(b => b.Duration.Contains(new LocalDate(2011, 1, 2)));




            public class BlogContext : DbContext

            protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
            => optionsBuilder.UseNpgsql("<connection string>", o => o.UseNodaTime());

            public DbSet<Blog> Blogs get; set;


            public class Blog

            public int Id get; set;
            public NpgsqlRange<LocalDate> Duration get; set;






            share|improve this answer

























            • Thanks a lot. It is working now. My problem was using wrong package for Nodatime:<!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> <!--Good one --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />

              – Marina
              Apr 1 at 6:58














            1












            1








            1







            There seems to be a bit of confusion in your code sample above - you are accessing property DateRange1 whereas the DBTable1 class seems to contain DateRange0.



            Npgsql supports two ways of interacting with date/time types: the built-in BCL types (e.g. DateTime) and the NodaTime library. The built-in DateTime type is supported, but is mapped by default to PostgreSQL timestamp rather than date, since it has a time components. Therefore, a property of type NpgsqlRange<DateTime> will cause Npgsql to create a tsrange column (range of timestamp), rather than a daterange). It's possible to explicitly specify daterange as the column type, but you will encounter some subtle problems with this (see this comment).



            If using NodaTime is OK, then things should work better, since NodaTime has a date-only type - LocalDate - so NpgsqlRange<LocalDate> automatically maps to daterange. To do this you will need to use the NodaTime plugin, as specified in the docs.



            Here's a full code sample for using a date range with NodaTime, including insertion and query:



            class Program

            static void Main(string[] args)

            using (var ctx = new BlogContext())

            ctx.Database.EnsureDeleted();
            ctx.Database.EnsureCreated();

            ctx.Blogs.Add(new Blog Duration = new NpgsqlRange<LocalDate>(new LocalDate(2011, 1, 1), new LocalDate(2011, 1, 3)) );
            ctx.SaveChanges();

            var x = ctx.Blogs.FirstOrDefault(b => b.Duration.Contains(new LocalDate(2011, 1, 2)));




            public class BlogContext : DbContext

            protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
            => optionsBuilder.UseNpgsql("<connection string>", o => o.UseNodaTime());

            public DbSet<Blog> Blogs get; set;


            public class Blog

            public int Id get; set;
            public NpgsqlRange<LocalDate> Duration get; set;






            share|improve this answer













            There seems to be a bit of confusion in your code sample above - you are accessing property DateRange1 whereas the DBTable1 class seems to contain DateRange0.



            Npgsql supports two ways of interacting with date/time types: the built-in BCL types (e.g. DateTime) and the NodaTime library. The built-in DateTime type is supported, but is mapped by default to PostgreSQL timestamp rather than date, since it has a time components. Therefore, a property of type NpgsqlRange<DateTime> will cause Npgsql to create a tsrange column (range of timestamp), rather than a daterange). It's possible to explicitly specify daterange as the column type, but you will encounter some subtle problems with this (see this comment).



            If using NodaTime is OK, then things should work better, since NodaTime has a date-only type - LocalDate - so NpgsqlRange<LocalDate> automatically maps to daterange. To do this you will need to use the NodaTime plugin, as specified in the docs.



            Here's a full code sample for using a date range with NodaTime, including insertion and query:



            class Program

            static void Main(string[] args)

            using (var ctx = new BlogContext())

            ctx.Database.EnsureDeleted();
            ctx.Database.EnsureCreated();

            ctx.Blogs.Add(new Blog Duration = new NpgsqlRange<LocalDate>(new LocalDate(2011, 1, 1), new LocalDate(2011, 1, 3)) );
            ctx.SaveChanges();

            var x = ctx.Blogs.FirstOrDefault(b => b.Duration.Contains(new LocalDate(2011, 1, 2)));




            public class BlogContext : DbContext

            protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
            => optionsBuilder.UseNpgsql("<connection string>", o => o.UseNodaTime());

            public DbSet<Blog> Blogs get; set;


            public class Blog

            public int Id get; set;
            public NpgsqlRange<LocalDate> Duration get; set;







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 27 at 10:39









            Shay RojanskyShay Rojansky

            7,6742 gold badges19 silver badges47 bronze badges




            7,6742 gold badges19 silver badges47 bronze badges















            • Thanks a lot. It is working now. My problem was using wrong package for Nodatime:<!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> <!--Good one --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />

              – Marina
              Apr 1 at 6:58


















            • Thanks a lot. It is working now. My problem was using wrong package for Nodatime:<!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> <!--Good one --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />

              – Marina
              Apr 1 at 6:58

















            Thanks a lot. It is working now. My problem was using wrong package for Nodatime:<!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> <!--Good one --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />

            – Marina
            Apr 1 at 6:58






            Thanks a lot. It is working now. My problem was using wrong package for Nodatime:<!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> <!--Good one --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />

            – Marina
            Apr 1 at 6:58














            0














            Problem was using wrong package for NodaTime:



            <!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> 
            <!--Good one -->
            <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />





            share|improve this answer





























              0














              Problem was using wrong package for NodaTime:



              <!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> 
              <!--Good one -->
              <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />





              share|improve this answer



























                0












                0








                0







                Problem was using wrong package for NodaTime:



                <!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> 
                <!--Good one -->
                <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />





                share|improve this answer













                Problem was using wrong package for NodaTime:



                <!--Wrong one <PackageReference Include="Npgsql.NodaTime" Version="4.0.5" /> --> <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" /> 
                <!--Good one -->
                <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.2.0" />






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 1 at 7:05









                MarinaMarina

                61 bronze badge




                61 bronze badge






























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55373227%2fcan-i-use-daterange-column-and-work-with-ef-for-postgresql-c%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현