Npgsql.EntityFrameworkCore.PostgreSQL 9.0.0-preview.7

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.

Showing the top 20 packages that depend on Npgsql.EntityFrameworkCore.PostgreSQL.

Packages Downloads
EfCore.SchemaCompare
Useful tool if you are changing the schema of your database's schema outside of EF Core' migrations, say by using SQL change scripts. See readme file on github.
3
EfCore.SchemaCompare
Useful tool if you are changing the schema of your database's schema outside of EF Core' migrations, say by using SQL change scripts. See readme file on github.
4
EfCore.SchemaCompare
Useful tool if you are changing the schema of your database's schema outside of EF Core' migrations, say by using SQL change scripts. See readme file on github.
6
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
2
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
3
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
4
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
5
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
6
Npgsql.EntityFrameworkCore.PostgreSQL.Design
PostgreSQL/Npgsql provider for Entity Framework Core.
6

.NET 8.0

Version Downloads Last updated
9.0.0-rc.2 3 19.10.2024
9.0.0-rc.1 4 22.09.2024
9.0.0-preview.7 4 24.10.2024
9.0.0-preview.3 4 22.09.2024
9.0.0-preview.2 6 22.09.2024
9.0.0-preview.1 5 26.02.2024
8.0.10 0 17.10.2024
8.0.8 0 27.09.2024
8.0.4 5 22.09.2024
8.0.2 5 09.05.2024
8.0.0 6 22.09.2024
8.0.0-rc.2 5 22.09.2024
8.0.0-rc.1 4 22.09.2024
8.0.0-preview.7 4 22.09.2024
8.0.0-preview.4 0 20.05.2023
8.0.0-preview.3 4 22.09.2024
8.0.0-preview.2 5 22.09.2024
8.0.0-preview.1 4 22.09.2024
7.0.18 6 22.09.2024
7.0.11 4 22.09.2024
7.0.4 6 22.09.2024
7.0.3 4 22.09.2024
7.0.1 4 22.09.2024
7.0.0 5 22.09.2024
7.0.0-rc.2 4 22.09.2024
7.0.0-rc.1 3 22.09.2024
7.0.0-preview.7 6 22.09.2024
7.0.0-preview.6 4 22.09.2024
7.0.0-preview.5 6 22.09.2024
7.0.0-preview.4 4 22.09.2024
7.0.0-preview.3 5 22.09.2024
7.0.0-preview.2 6 22.09.2024
7.0.0-preview.1 6 22.09.2024
6.0.29 4 22.09.2024
6.0.22 4 22.09.2024
6.0.8 5 22.09.2024
6.0.7 5 22.09.2024
6.0.6 5 22.09.2024
6.0.5 4 22.09.2024
6.0.4 4 22.09.2024
6.0.3 3 22.09.2024
6.0.2 6 22.09.2024
6.0.1 4 22.09.2024
6.0.0 4 22.09.2024
6.0.0-rc.2 4 22.09.2024
6.0.0-rc.1 4 22.09.2024
6.0.0-preview7 4 22.09.2024
6.0.0-preview6 0 31.07.2021
6.0.0-preview5 4 22.09.2024
6.0.0-preview4 3 22.09.2024
6.0.0-preview3 4 22.09.2024
6.0.0-preview2 6 22.09.2024
6.0.0-preview1 3 22.09.2024
5.0.10 3 22.09.2024
5.0.7 4 22.09.2024
5.0.6 5 22.09.2024
5.0.5.1 4 22.09.2024
5.0.5 4 22.09.2024
5.0.2 5 22.09.2024
5.0.1 4 22.09.2024
5.0.0 4 22.09.2024
3.1.18 0 27.08.2021
3.1.11 4 22.09.2024
3.1.4 3 22.09.2024
3.1.3 0 26.03.2020
3.1.2 5 22.09.2024
3.1.1.2 5 22.09.2024
3.1.1.1 4 22.09.2024
3.1.1 4 22.09.2024
3.1.0 3 23.10.2024
3.0.1 4 22.09.2024
3.0.0 4 22.09.2024
2.2.4 4 22.09.2024
2.2.0 5 22.09.2024
2.1.2 4 22.09.2024
2.1.1.1 4 22.09.2024
2.1.1 4 22.09.2024
2.1.0 4 22.09.2024
2.0.2 4 22.09.2024
2.0.1 5 22.09.2024
2.0.0 4 22.09.2024
1.1.1 4 22.09.2024
1.1.0 5 22.09.2024
1.0.2 4 22.09.2024
1.0.1 4 22.09.2024
1.0.0 3 22.09.2024