ErikEJ.EntityFramework.SqlServerCompact
6.4.0-beta2
Prefix Reserved
See the version list below for details.
Requires NuGet 5.0 or higher.
dotnet add package ErikEJ.EntityFramework.SqlServerCompact --version 6.4.0-beta2
NuGet\Install-Package ErikEJ.EntityFramework.SqlServerCompact -Version 6.4.0-beta2
<PackageReference Include="ErikEJ.EntityFramework.SqlServerCompact" Version="6.4.0-beta2" />
paket add ErikEJ.EntityFramework.SqlServerCompact --version 6.4.0-beta2
#r "nuget: ErikEJ.EntityFramework.SqlServerCompact, 6.4.0-beta2"
// Install ErikEJ.EntityFramework.SqlServerCompact as a Cake Addin #addin nuget:?package=ErikEJ.EntityFramework.SqlServerCompact&version=6.4.0-beta2&prerelease // Install ErikEJ.EntityFramework.SqlServerCompact as a Cake Tool #tool nuget:?package=ErikEJ.EntityFramework.SqlServerCompact&version=6.4.0-beta2&prerelease
Entity Framework 6 SQL Server Compact provider for .NET 5 (and later)
This Entity Framework provider includes everything required to start creating and using a SQL Server Compact embedded database with Entity Framework 6.
You can read more about using the SQL Server Compact ADO.NET provider with .NET Core in my blog post here
Getting started
Add a PackageReference like this to use the latest preview build:
<ItemGroup>
<PackageReference Include="ErikEJ.EntityFramework.SqlServerCompact" Version="6.4.0-*" />
</ItemGroup>
Provider Configuration
There are various ways to configure Entity Framework to use this provider.
You can register the provider in code using an attribute:
[DbConfigurationType(typeof(SqlCeDbConfiguration))]
public class SchoolContext : DbContext
{
public SchoolContext() : base()
{
}
public DbSet<Student> Students { get; set; }
}
If you have multiple classes inheriting from DbContext in your solution, add the DbConfigurationType attribute to all of them.
Or you can use the SetConfiguration method before any data access calls:
DbConfiguration.SetConfiguration(new SqlCeDbConfiguration());
Or you can add the following lines to your existing DbConfiguration class:
SetProviderFactory(SqlCeProviderServices.ProviderInvariantName, SqlServerCe.SqlCeProviderFactory.Instance);
SetProviderServices(SqlCeProviderServices.ProviderInvariantName, SqlCeProviderServices.Instance);
You can also use XML/App.Config based configuration:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServer.SqlCeProviderServices, ErikEJ.EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>
</configuration>
If you use App.Config with a .NET Core / .NET 5 or later app, you must register the DbProviderFactory in code once:
DbProviderFactories.RegisterFactory(SqlCeProviderServices.ProviderInvariantName, SqlServerCe.SqlCeProviderFactory.Instance);
Feedback
Please report any issues, questions and suggestions here
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net5.0
- EntityFramework (>= 6.4.0)
- Microsoft.Windows.Compatibility (>= 5.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
6.4.0-beta5 | 916 | 9/5/2023 |
6.4.0-beta4 | 267 | 4/6/2023 |
6.4.0-beta3 | 150 | 11/24/2022 |
6.4.0-beta2 | 273 | 10/10/2021 |
6.4.0-beta1 | 164 | 10/10/2021 |
Initial preview