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

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript