You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GaussDB Entity Framework Core provider for PostgreSQL
DotNetCore.EntityFrameworkCore.GaussDB 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 DotNetCore.GaussDB.
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.UseGaussDB(@"host={host};port={port};username={username};password={password};database={database}");}publicclassBlog{publicintId{get;set;}publicstringName{get;set;}}
About
Entity Framework Core provider for GaussDB Database