Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotnetcore/entityframeworkcore.gaussdb
Entity Framework Core provider for GaussDB Database
https://github.com/dotnetcore/entityframeworkcore.gaussdb
database entity-framework entity-framework-core gaussdb orm
Last synced: 3 months ago
JSON representation
Entity Framework Core provider for GaussDB Database
- Host: GitHub
- URL: https://github.com/dotnetcore/entityframeworkcore.gaussdb
- Owner: dotnetcore
- License: postgresql
- Created: 2023-10-11T12:59:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-14T13:07:16.000Z (11 months ago)
- Last Synced: 2024-03-25T21:32:27.350Z (11 months ago)
- Topics: database, entity-framework, entity-framework-core, gaussdb, orm
- Language: C#
- Homepage:
- Size: 360 KB
- Stars: 22
- Watchers: 9
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GaussDB Entity Framework Core provider for PostgreSQL
[![Member project of .NET Core Community](https://img.shields.io/badge/member%20project%20of-NCC-9e20c9.svg)](https://github.com/dotnetcore)
[![nuget](https://img.shields.io/nuget/v/DotNetCore.EntityFrameworkCore.GaussDB.svg?style=flat-square)](https://www.nuget.org/packages/DotNetCore.EntityFrameworkCore.GaussDB)
[![stats](https://img.shields.io/nuget/dt/DotNetCore.EntityFrameworkCore.GaussDB.svg?style=flat-square)](https://www.nuget.org/stats/packages/DotNetCore.EntityFrameworkCore.GaussDB?groupby=Version)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](https://github.com/dotnetcore/DotNetCore.GaussDB).
The provider looks and feels just like any other Entity Framework Core provider. Here's a quick sample to get you started:
```csharp
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 Blogs { get; set; }protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
=> optionsBuilder.UseGaussDB(@"host={host};port={port};username={username};password={password};database={database}");
}public class Blog
{
public int Id { get; set; }
public string Name { get; set; }
}
```