Npgsql.EntityFrameworkCore.PostgreSQL 9.0.2

Prefix Reserved
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 9.0.2                
NuGet\Install-Package Npgsql.EntityFrameworkCore.PostgreSQL -Version 9.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Npgsql.EntityFrameworkCore.PostgreSQL --version 9.0.2                
#r "nuget: Npgsql.EntityFrameworkCore.PostgreSQL, 9.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Npgsql.EntityFrameworkCore.PostgreSQL as a Cake Addin
#addin nuget:?package=Npgsql.EntityFrameworkCore.PostgreSQL&version=9.0.2

// Install Npgsql.EntityFrameworkCore.PostgreSQL as a Cake Tool
#tool nuget:?package=Npgsql.EntityFrameworkCore.PostgreSQL&version=9.0.2                

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. It's built on top of Npgsql.

The provider looks and feels just like any other Entity Framework Core provider. Here's a quick sample to get you started:

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

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

// Query all blogs who's name starts with F
var fBlogs = await ctx.Blogs.Where(b => b.Name.StartsWith("F")).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");
}

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

Aside from providing general EF Core support for PostgreSQL, the provider also exposes some PostgreSQL-specific capabilities, allowing you to query JSON, array or range columns, as well as many other advanced features. For more information, see the the Npgsql site. For information about EF Core in general, see the EF Core website.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1.3K)

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

Package Downloads
Npgsql.EntityFrameworkCore.PostgreSQL.Design

PostgreSQL/Npgsql provider for Entity Framework Core.

Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite

NetTopologySuite PostGIS spatial support plugin for PostgreSQL/Npgsql Entity Framework Core provider.

Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime

NodaTime support plugin for PostgreSQL/Npgsql Entity Framework Core provider.

Npgsql.Bulk

Extension for Entity Framework Npgsql for Bulk Copy

EfCore.TestSupport

Useful tools when unit testing applications that use Entity Framework Core. See readme file on github.

GitHub repositories (245)

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

Repository Stars
dotnet/aspnetcore
ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
jasontaylordev/CleanArchitecture
Clean Architecture Solution Template for ASP.NET Core
bitwarden/server
Bitwarden infrastructure/backend (API, database, Docker, etc).
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
MassTransit/MassTransit
Distributed Application Framework for .NET
Version Downloads Last updated
9.0.2 151,927 12/7/2024
9.0.1 318,110 11/19/2024
9.0.0-rc.2 64,292 10/13/2024
9.0.0-rc.1 46,931 9/13/2024
9.0.0-preview.7 8,403 9/1/2024
9.0.0-preview.3 113,207 4/12/2024
9.0.0-preview.2 12,788 3/22/2024
9.0.0-preview.1 33,602 2/14/2024
8.0.11 654,803 11/18/2024
8.0.10 1,982,361 10/17/2024
8.0.8 1,503,320 9/27/2024
8.0.4 14,289,675 5/11/2024
8.0.2 8,562,353 2/17/2024
8.0.0 7,705,790 11/21/2023
8.0.0-rc.2 162,909 10/11/2023
8.0.0-rc.1 57,178 9/14/2023
8.0.0-preview.7 15,985 8/18/2023
8.0.0-preview.4 68,594 5/20/2023
8.0.0-preview.3 37,352 4/24/2023
8.0.0-preview.2 28,744 3/20/2023
8.0.0-preview.1 62,777 3/3/2023
7.0.18 948,482 5/11/2024
7.0.11 7,981,417 9/15/2023
7.0.4 12,029,341 4/24/2023
7.0.3 7,467,499 2/15/2023
7.0.1 5,196,712 12/17/2022
7.0.0 3,129,078 11/9/2022
7.0.0-rc.2 56,659 10/11/2022
7.0.0-rc.1 16,705 9/16/2022
7.0.0-preview.7 16,115 8/9/2022
7.0.0-preview.6 14,746 7/13/2022
7.0.0-preview.5 10,629 6/19/2022
7.0.0-preview.4 17,613 5/11/2022
7.0.0-preview.3 13,312 4/19/2022
7.0.0-preview.2 24,323 3/16/2022
7.0.0-preview.1 10,206 2/17/2022
6.0.29 945,102 5/11/2024
6.0.22 1,962,412 9/15/2023
6.0.8 9,659,918 12/17/2022
6.0.7 9,462,907 9/16/2022
6.0.6 8,471,658 8/4/2022
6.0.5 5,967,731 6/19/2022
6.0.4 8,327,924 4/19/2022
6.0.3 7,600,330 1/27/2022
6.0.2 3,890,856 12/22/2021
6.0.1 5,175,466 12/3/2021
6.0.0 4,118,531 11/9/2021
6.0.0-rc.2 132,995 10/14/2021
6.0.0-rc.1 128,667 9/24/2021
6.0.0-preview7 19,899 8/16/2021
6.0.0-preview6 5,916 7/31/2021
6.0.0-preview5 44,089 7/1/2021
6.0.0-preview4 32,075 5/27/2021
6.0.0-preview3 22,815 4/15/2021
6.0.0-preview2 9,205 3/11/2021
6.0.0-preview1 12,667 2/16/2021
5.0.10 7,894,677 9/15/2021
5.0.7 5,382,584 6/13/2021
5.0.6 1,781,239 5/11/2021
5.0.5.1 1,257,957 4/21/2021
5.0.5 408,105 4/16/2021
5.0.2 4,509,692 1/19/2021
5.0.1 1,450,120 12/12/2020
5.0.0 1,817,963 11/15/2020
3.1.18 2,593,244 8/27/2021
3.1.11 2,763,406 1/21/2021
3.1.4 12,120,179 5/29/2020
3.1.3 3,297,608 3/26/2020
3.1.2 1,965,023 2/20/2020
3.1.1.2 763,728 2/6/2020
3.1.1.1 187,451 2/3/2020
3.1.1 353,456 1/31/2020
3.1.0 2,934,928 12/4/2019
3.0.1 1,034,938 10/2/2019
3.0.0 267,441 9/26/2019
2.2.4 5,360,701 5/21/2019
2.2.0 5,456,620 12/7/2018
2.1.2 3,591,815 9/8/2018
2.1.1.1 1,186,062 7/15/2018
2.1.1 686,941 7/1/2018
2.1.0 1,288,551 5/31/2018
2.0.2 543,553 4/22/2018
2.0.1 568,514 1/11/2018
2.0.0 989,036 8/16/2017
1.1.1 266,457 7/25/2017
1.1.0 1,089,939 11/20/2016
1.0.2 75,383 9/24/2016
1.0.1 126,880 7/21/2016
1.0.0 197,912 6/29/2016