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.
Ensure that your .csproj
file contains the following reference:
<PackageReference Include="DotNetCore.EntityFrameworkCore.KingbaseES" Version="6.0.22" />
Add DotNetCore.EntityFrameworkCore.KingbaseES
to the services configuration in your the Startup.cs
file of your ASP.NET Core project:
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
// Replace with your connection string.
var connectionString = "host={host};port={port};database={database};username={username};password={password};";
// Replace 'YourDbContext' with the name of your own DbContext derived class.
services.AddDbContext<YourDbContext>(
dbContextOptions => dbContextOptions
.UseKdbndp(connectionString)
);
}
}
Check out our Basic Test for an example repository that includes an ASP.NET Core MVC Application.
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
).
Refer to Microsoft's EF Core Documentation for detailed instructions and examples on using EF Core.
Use the EF Core tools to execute scaffolding commands:
dotnet ef dbcontext scaffold "Server=localhost;User=root;Password=1234;Database=ef" "DotNetCore.EntityFrameworkCore.KingbaseES"
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.
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.