npgsql-vnext - Npgsql.EntityFrameworkCore.PostgreSQL 9.0.0-preview.3-ci.20240401T091105+sha.dcef41511
PostgreSQL/Npgsql provider for Entity Framework Core.
PM> Install-Package Npgsql.EntityFrameworkCore.PostgreSQL -Version 9.0.0-preview.3-ci.20240401T091105 -Source https://www.myget.org/F/npgsql-vnext/api/v3/index.json
> nuget.exe install Npgsql.EntityFrameworkCore.PostgreSQL -Version 9.0.0-preview.3-ci.20240401T091105 -Source https://www.myget.org/F/npgsql-vnext/api/v3/index.json
> dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 9.0.0-preview.3-ci.20240401T091105 --source https://www.myget.org/F/npgsql-vnext/api/v3/index.json
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0-preview.3-ci.20240401T091105" />
Copy to clipboard
source https://www.myget.org/F/npgsql-vnext/api/v3/index.json
nuget Npgsql.EntityFrameworkCore.PostgreSQL ~> 9.0.0-preview.3-ci.20240401T091105
Copy to clipboard
> choco install Npgsql.EntityFrameworkCore.PostgreSQL --version 9.0.0-preview.3-ci.20240401T091105 --source https://www.myget.org/F/npgsql-vnext/api/v2
Import-Module PowerShellGet
Register-PSRepository -Name "npgsql-vnext" -SourceLocation "https://www.myget.org/F/npgsql-vnext/api/v2"
Install-Module -Name "Npgsql.EntityFrameworkCore.PostgreSQL" -RequiredVersion "9.0.0-preview.3-ci.20240401T091105" -Repository "npgsql-vnext" -AllowPreRelease
Copy to clipboard
Browse the sources in this package using Visual Studio or WinDbg by configuring the following symbol server URL: https://www.myget.org/F/npgsql-vnext/api/v2/symbolpackage/
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.
Related packages
- Spatial plugin to work with PostgreSQL PostGIS: Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite
- NodaTime plugin to use better date/time types with PostgreSQL: Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime
- The underlying Npgsql ADO.NET provider is Npgsql.
-
.NETFramework 8.0
- Microsoft.EntityFrameworkCore (>= 9.0.0-preview.2.24128.4)
- Microsoft.EntityFrameworkCore.Abstractions (>= 9.0.0-preview.2.24128.4)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.0-preview.2.24128.4)
- Npgsql (>= 8.0.2)
- .NETFramework 8.0: 8.0.0.0
OwnersShay Rojansky |
AuthorsShay Rojansky, Austin Drenski, Yoh Deadfall |
Project URLhttps://github.com/npgsql/efcore.pg |
LicenseUnknown |
Tagsnpgsql postgresql postgres Entity Framework Core entity-framework-core ef efcore orm sql |
Info184 total downloads |
3 downloads for version 9.0.0-preview.3-ci.20240401T091105+sha.dcef41511 |
Download (305.69 KB) |
Download symbols (87.06 KB) |
Found on the current feed only |