npgsql-vnext - Npgsql.EntityFrameworkCore.PostgreSQL 9.0.0-rc.1-ci.20240915T104507+sha.318c46ce5
PostgreSQL/Npgsql provider for Entity Framework Core.
PM> Install-Package Npgsql.EntityFrameworkCore.PostgreSQL -Version 9.0.0-rc.1-ci.20240915T104507 -Source https://www.myget.org/F/npgsql-vnext/api/v3/index.json
> nuget.exe install Npgsql.EntityFrameworkCore.PostgreSQL -Version 9.0.0-rc.1-ci.20240915T104507 -Source https://www.myget.org/F/npgsql-vnext/api/v3/index.json
> dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 9.0.0-rc.1-ci.20240915T104507 --source https://www.myget.org/F/npgsql-vnext/api/v3/index.json
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0-rc.1-ci.20240915T104507" />
Copy to clipboard
source https://www.myget.org/F/npgsql-vnext/api/v3/index.json
nuget Npgsql.EntityFrameworkCore.PostgreSQL ~> 9.0.0-rc.1-ci.20240915T104507
Copy to clipboard
> choco install Npgsql.EntityFrameworkCore.PostgreSQL --version 9.0.0-rc.1-ci.20240915T104507 --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-rc.1-ci.20240915T104507" -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.7.24405.3)
- Microsoft.EntityFrameworkCore.Relational (= 9.0.0-preview.7.24405.3)
- Npgsql (>= 8.0.3)
- .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 |
Info100 total downloads |
1 downloads for version 9.0.0-rc.1-ci.20240915T104507+sha.318c46ce5 |
Download (320.23 KB) |
Download symbols (90.36 KB) |
Found on the current feed only |