Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime 10.0.0-preview.5

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.

No packages depend on Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime.

.NET 10.0

Version Downloads Last updated
10.0.0-preview.5 2 06/28/2025
10.0.0-preview.3 2 06/07/2025
10.0.0-preview.2 2 06/07/2025
10.0.0-preview.1 3 03/09/2025
9.0.4 5 03/09/2025
9.0.3 3 01/31/2025
9.0.2 3 01/31/2025
9.0.1 3 01/31/2025
9.0.0 3 01/31/2025
9.0.0-rc.2 3 01/31/2025
9.0.0-rc.1 3 01/31/2025
9.0.0-preview.7 3 01/31/2025
9.0.0-preview.3 3 01/31/2025
9.0.0-preview.2 3 01/31/2025
9.0.0-preview.1 3 01/31/2025
8.0.11 3 01/31/2025
8.0.10 3 01/31/2025
8.0.8 3 01/31/2025
8.0.4 3 01/31/2025
8.0.2 3 02/26/2025
8.0.0 3 01/31/2025
8.0.0-rc.2 3 01/31/2025
8.0.0-rc.1 4 01/31/2025
8.0.0-preview.7 3 01/31/2025
8.0.0-preview.4 3 01/31/2025
8.0.0-preview.3 3 01/31/2025
8.0.0-preview.2 3 01/31/2025
8.0.0-preview.1 3 01/31/2025
7.0.18 3 01/31/2025
7.0.11 3 01/31/2025
7.0.4 4 01/20/2025
7.0.3 3 02/26/2025
7.0.1 3 01/31/2025
7.0.0 3 01/31/2025
7.0.0-rc.2 3 01/31/2025
7.0.0-rc.1 3 02/26/2025
7.0.0-preview.7 3 01/31/2025
7.0.0-preview.6 3 01/31/2025
7.0.0-preview.5 3 01/31/2025
7.0.0-preview.4 3 01/31/2025
7.0.0-preview.3 3 01/31/2025
7.0.0-preview.2 3 01/31/2025
7.0.0-preview.1 3 01/31/2025
6.0.29 3 01/31/2025
6.0.22 3 01/31/2025
6.0.8 3 01/31/2025
6.0.7 3 01/31/2025
6.0.6 3 01/31/2025
6.0.5 3 01/31/2025
6.0.4 2 03/09/2025
6.0.3 3 01/31/2025
6.0.2 3 01/31/2025
6.0.1 3 01/31/2025
6.0.0 3 01/31/2025
6.0.0-rc.2 3 01/31/2025
6.0.0-rc.1 2 03/09/2025
6.0.0-preview7 3 01/31/2025
6.0.0-preview6 3 02/26/2025
6.0.0-preview5 3 01/31/2025
6.0.0-preview4 4 01/31/2025
6.0.0-preview3 3 01/31/2025
6.0.0-preview2 3 01/31/2025
6.0.0-preview1 3 01/31/2025
5.0.10 3 01/31/2025
5.0.7 3 01/31/2025
5.0.6 3 01/31/2025
5.0.5.1 3 01/31/2025
5.0.5 3 01/31/2025
5.0.2 4 01/31/2025
5.0.1 3 01/31/2025
5.0.0 3 01/31/2025
5.0.0-rc2 3 01/31/2025
5.0.0-rc1 3 01/31/2025
5.0.0-preview8 3 01/31/2025
5.0.0-preview7 3 01/31/2025
5.0.0-preview6 3 01/31/2025
5.0.0-preview5 3 01/31/2025
5.0.0-preview4 3 01/31/2025
5.0.0-preview3 3 01/31/2025
5.0.0-preview2 3 01/31/2025
5.0.0-preview.2.20120.8 4 01/31/2025
3.1.18 3 01/31/2025
3.1.11 3 01/31/2025
3.1.4 3 01/31/2025
3.1.3 3 01/31/2025
3.1.2 3 01/31/2025
3.1.1 3 01/31/2025
3.1.0 3 01/31/2025
3.1.0-preview3 3 01/31/2025
3.1.0-preview2 3 01/31/2025
3.0.1 3 02/26/2025
3.0.0 3 01/31/2025
3.0.0-preview9 3 01/31/2025
3.0.0-preview8 3 01/31/2025
3.0.0-preview7 3 01/31/2025
3.0.0-preview5 3 01/31/2025
3.0.0-preview4 3 01/31/2025
3.0.0-preview3 3 01/31/2025
3.0.0-preview1 3 01/31/2025
2.2.4 3 01/31/2025
2.2.0 3 01/31/2025
2.1.1 3 01/31/2025
2.1.0 3 01/31/2025
2.1.0-rc1 3 02/26/2025