GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - npgsql/efcore.pg: Entity Framework Core provider for PostgreSQL

BranchesTags
Open more actions menu

Latest commit

 

History

2,073 Commits
2,073 Commits

Folders and files

NameName
Last commit message
Last commit date
.agents/skills
.agents/skills
 
 
.build
.build
 
 
.github
.github
 
 
src
src
 
 
test
test
 
 
tools
tools
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
Directory.Build.props
Directory.Build.props
 
 
Directory.Packages.props
Directory.Packages.props
 
 
EFCore.PG.slnx
EFCore.PG.slnx
 
 
EFCore.PG.slnx.DotSettings
EFCore.PG.slnx.DotSettings
 
 
LICENSE
LICENSE
 
 
Npgsql.snk
Npgsql.snk
 
 
NuGet.config
NuGet.config
 
 
QueryBaseline.cs
QueryBaseline.cs
 
 
README.md
README.md
 
 
empty
empty
 
 
global.json
global.json
 
 
postgresql.png
postgresql.png
 
 

Repository files navigation

Npgsql Entity Framework Core provider for PostgreSQL

stable next patch daily builds (vnext) build gitter

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.

About

Entity Framework Core provider for PostgreSQL

Topics

databasedotnetentity-frameworkentity-framework-corenpgsqlpostgrespostgresqlsql

Resources

Readme
PostgreSQL license
Activity
Custom properties

Stars

1.8k stars

Watchers

50 watching

Forks

280 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.