SingleStore.EntityFrameworkCore is the Entity Framework Core provider for SingleStore. It uses SingleStoreConnector for high-performance database server communication.
| Milestone | Status | Release Date |
|---|---|---|
| 8.0.1 | released | January 2026 |
| 8.0.0 | released | July 2025 |
| 7.0.1 | released | March 2025 |
| 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="8.0.0" />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"
SingleStore does not support changing @@session.time_zone at runtime (it is a MySQL-compatibility variable and remains SYSTEM).
If you need DateTimeOffset.LocalDateTime translation, configure a session time zone offset in the provider:
optionsBuilder.UseSingleStore(cs, o => o.SessionTimeZone("-08:00"));If not configured, the provider defaults to +00:00 (UTC).