SingleStore.EntityFrameworkCore
is the Entity Framework Core provider for SingleStore. It uses SingleStoreConnector for high-performance database server communication.
Milestone | Status | Release Date |
---|---|---|
7.0.0 | released | November 2024 |
6.0.2 | general availability | April 2024 |
Ensure that your .csproj
file contains the following reference:
<PackageReference Include="EntityFrameworkCore.SingleStore" Version="6.0.2" />
Add EntityFrameworkCore.SingleStore
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 = "server=localhost;user=root;password=1234;database=ef";
// Replace 'YourDbContext' with the name of your own DbContext derived class.
services.AddDbContext<YourDbContext>(
dbContextOptions => dbContextOptions
.UseSingleStore(connectionString)
// The following three options help with debugging, but should
// be changed or removed for production.
.LogTo(Console.WriteLine, LogLevel.Information)
.EnableSensitiveDataLogging()
.EnableDetailedErrors()
);
}
}
View our Configuration Options Wiki Page for a list of common options.
Check out our Integration Tests 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" "SingleStore.EntityFrameworkCore"