Skip to content

Commit aa64e11

Browse files
authored
Update README.md
1 parent b23f29d commit aa64e11

File tree

1 file changed

+55
-21
lines changed

1 file changed

+55
-21
lines changed

README.md

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,66 @@
11
# DotNetCore Entity Framework Core provider for KingbaseES for R6 V008R006C008B0014
22

3-
DotNetCore.EntityFrameworkCore.KingbaseES is the open source EF Core provider for KingbaseES. It allows you to interact with KingbaseES via the most widely-used .NET O/RM from Microsoft, and use familiar LINQ syntax to express queries.
3+
[![Member project of .NET Core Community](https://img.shields.io/badge/member%20project%20of-NCC-9e20c9.svg)](https://github.com/dotnetcore)
4+
[![nuget](https://img.shields.io/nuget/v/DotNetCore.EntityFrameworkCore.KingbaseES.svg?style=flat-square)](https://www.nuget.org/packages/DotNetCore.EntityFrameworkCore.KingbaseES)
5+
[![stats](https://img.shields.io/nuget/dt/DotNetCore.EntityFrameworkCore.KingbaseES.svg?style=flat-square)](https://www.nuget.org/stats/packages/DotNetCore.EntityFrameworkCore.KingbaseES?groupby=Version)
46

5-
The provider looks and feels just like any other Entity Framework Core provider. Here's a quick sample to get you started:
7+
`DotNetCore.EntityFrameworkCore.KingbaseES` is an open source Entity Framework Core provider for KingbaseES. It supports you to interact with KingbaseES via EFCore, the most widely-used .NET O/RM from Microsoft, up to its latest version, and use familiar LINQ syntax to express queries.
68

7-
```csharp
8-
await using var ctx = new BlogContext();
9-
await ctx.Database.EnsureDeletedAsync();
10-
await ctx.Database.EnsureCreatedAsync();
9+
## Getting Started
1110

12-
// Insert a Blog
13-
ctx.Blogs.Add(new() { Name = "FooBlog" });
14-
await ctx.SaveChangesAsync();
11+
### 1. Project Configuration
1512

16-
// Query all blogs who's name starts with F
17-
var fBlogs = await ctx.Blogs.Where(b => b.Name.StartsWith("F")).ToListAsync();
13+
Ensure that your `.csproj` file contains the following reference:
1814

19-
public class BlogContext : DbContext
20-
{
21-
public DbSet<Blog> Blogs { get; set; }
15+
```xml
16+
<PackageReference Include="DotNetCore.EntityFrameworkCore.KingbaseES" Version="6.0.22" />
17+
```
2218

23-
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
24-
=> optionsBuilder.UseKdbndp(@"host={host};port={port};database={database};username={username};password={password};");
25-
}
19+
### 2. Services Configuration
2620

27-
public class Blog
21+
Add `DotNetCore.EntityFrameworkCore.KingbaseES` to the services configuration in your the `Startup.cs` file of your ASP.NET Core project:
22+
23+
```csharp
24+
public class Startup
2825
{
29-
public int Id { get; set; }
30-
public string Name { get; set; }
26+
public void ConfigureServices(IServiceCollection services)
27+
{
28+
// Replace with your connection string.
29+
var connectionString = "host={host};port={port};database={database};username={username};password={password};";
30+
31+
// Replace 'YourDbContext' with the name of your own DbContext derived class.
32+
services.AddDbContext<YourDbContext>(
33+
dbContextOptions => dbContextOptions
34+
.UseKdbndp(connectionString)
35+
);
36+
}
3137
}
32-
```
38+
```
39+
40+
### 3. Sample Application
41+
42+
Check out our [Basic Test](https://github.com/dotnetcore/EntityFrameworkCore.KingbaseES/tree/main/test/KingbaseES.BasicTest) for an example repository that includes an ASP.NET Core MVC Application.
43+
44+
There are also many complete and concise console application samples posted in the issue section (some of them can be found by searching for `Program.cs`).
45+
46+
### 4. Read the EF Core Documentation
47+
48+
Refer to Microsoft's [EF Core Documentation](https://docs.microsoft.com/en-us/ef/core/) for detailed instructions and examples on using EF Core.
49+
50+
## Scaffolding / Reverse Engineering
51+
52+
Use the [EF Core tools](https://docs.microsoft.com/en-us/ef/core/cli/dotnet) to execute scaffolding commands:
53+
54+
```
55+
dotnet ef dbcontext scaffold "Server=localhost;User=root;Password=1234;Database=ef" "DotNetCore.EntityFrameworkCore.KingbaseES"
56+
```
57+
58+
## Contribute
59+
60+
One of the easiest ways to contribute is to report issues and participate in discussions. You can also contribute by submitting pull requests with code changes and supporting tests.
61+
62+
We are always looking for additional core contributors. If you got a couple of hours a week and know your way around EF Core and KingbaseES, give us a nudge.
63+
64+
## License
65+
66+
[PostgreSQL license](https://github.com/dotnetcore/EntityFrameworkCore.KingbaseES/blob/main/LICENSE)

0 commit comments

Comments
 (0)