- Notifications
You must be signed in to change notification settings - Fork246
Entity Framework Core provider for PostgreSQL
License
npgsql/efcore.pg
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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 ofNpgsql.
The provider looks and feels just like any other Entity Framework Core provider. Here's a quick sample to get you started:
awaitusingvarctx=newBlogContext();awaitctx.Database.EnsureDeletedAsync();awaitctx.Database.EnsureCreatedAsync();// Insert a Blogctx.Blogs.Add(new(){Name="FooBlog"});awaitctx.SaveChangesAsync();// Query all blogs who's name starts with FvarfBlogs=awaitctx.Blogs.Where(b=>b.Name.StartsWith("F")).ToListAsync();publicclassBlogContext:DbContext{publicDbSet<Blog>Blogs{get;set;}protectedoverridevoidOnConfiguring(DbContextOptionsBuilderoptionsBuilder)=>optionsBuilder.UseNpgsql(@"Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase");}publicclassBlog{publicintId{get;set;}publicstringName{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 thethe Npgsql site. For information about EF Core in general, see theEF Core website.
- 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 isNpgsql.
About
Entity Framework Core provider for PostgreSQL
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.