Npgsql Entity Framework Core provider for PostgreSQL

Npgsql.EntityFrameworkCore.PostgreSQL is the open source EF Core provider for PostgreSQL. It allows you to interact with PostgreSQL via the most widely-used .NET O/RM from Microsoft, and use familiar LINQ syntax to express queries.

This package is a plugin which allows you to use the NodaTime date/time library when interacting with PostgreSQL; this provides a better and safer API for dealing with date and time data.

To use the plugin, simply add UseNodaTime as below and use NodaTime types in your entity properties:

await using var ctx = new BlogContext();
await ctx.Database.EnsureDeletedAsync();
await ctx.Database.EnsureCreatedAsync();

// Insert a Blog
ctx.Blogs.Add(new()
{
    Name = "FooBlog",
    CreationTime = SystemClock.Instance.GetCurrentInstant()
});
await ctx.SaveChangesAsync();

// Query all blogs created in 2020 or after
var newBlogs = await ctx.Blogs.Where(b => b.CreationTime >= Instant.FromUtc(2020, 1, 1, 0, 0, 0)).ToListAsync();

public class BlogContext : DbContext
{
    public DbSet<Blog> Blogs { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        => optionsBuilder.UseNpgsql(
            @"Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase",
            o => o.UseNodaTime());
}

public class Blog
{
    public int Id { get; set; }
    public string Name { get; set; }
    public Instant CreationTime { get; set; }
}

The plugin also supports translating most NodaTime methods and properties into corresponding PostgreSQL date/time operations. For more information, see the NodaTime plugin documentation page.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 

NuGet packages (19)

Showing the top 5 NuGet packages that depend on Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime:

Package Downloads
devprime.stack.state

DevPrime State

SvrdSdk.AspNetCore

Package Description

EasyDesk.CleanArchitecture.Dal.PostgreSql

Utilities for the SqlServer data access layer of the clean architecture as seen by EasyDesk.

CockroachDB.EFCore.Provider

Package Description

LS.Helpers.Hosting

.NET Core helpers for ASP.NET hosting

GitHub repositories (6)

Showing the top 6 popular GitHub repositories that depend on Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime:

Repository Stars
ChilliCream/graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Nitro the awesome Monaco based GraphQL IDE.

linq2db/linq2db

Linq to database provider.

ErikEJ/EFCorePowerTools

Entity Framework Core Power Tools - reverse engineering, migrations and model visualization in Visual Studio & CLI

linq2db/linq2db.EntityFrameworkCore

Bring power of Linq To DB to Entity Framework Core projects

carlreid/StreamMaster

A powerful M3U proxy and stream management platform for Plex DVR, Emby, Jellyfin Live TV (and more)

NosCoreIO/NosCore

NosCore is a Nostale emulator in c# (.Net 10) using SuperSocket / Entity Framework / WebAPI / Autofac / Mapster / Serilog

Version Downloads Last Updated
11.0.0-preview.1 84 2/10/2026
10.0.0 214,173 11/22/2025
10.0.0-rc.2 6,510 10/16/2025
10.0.0-rc.1 2,295 9/10/2025
10.0.0-preview.7 1,082 8/17/2025
10.0.0-preview.5 1,755 6/11/2025
10.0.0-preview.3 516 4/12/2025
10.0.0-preview.2 497 3/24/2025
10.0.0-preview.1 193 3/1/2025
9.0.4 1,469,816 3/1/2025
9.0.3 230,734 1/17/2025
9.0.2 126,855 12/7/2024
9.0.1 83,093 11/19/2024
9.0.0 14,490 11/18/2024
9.0.0-rc.2 3,667 10/13/2024
9.0.0-rc.1 1,131 9/13/2024
9.0.0-preview.7 366 9/1/2024
8.0.11 557,649 11/18/2024
8.0.10 428,116 10/17/2024
8.0.8 214,966 9/27/2024