Dorssel.EntityFrameworkCore.Sqlite.Timestamp
8.0.3
dotnet add package Dorssel.EntityFrameworkCore.Sqlite.Timestamp --version 8.0.3
NuGet\Install-Package Dorssel.EntityFrameworkCore.Sqlite.Timestamp -Version 8.0.3
<PackageReference Include="Dorssel.EntityFrameworkCore.Sqlite.Timestamp" Version="8.0.3" />
<PackageVersion Include="Dorssel.EntityFrameworkCore.Sqlite.Timestamp" Version="8.0.3" />
<PackageReference Include="Dorssel.EntityFrameworkCore.Sqlite.Timestamp" />
paket add Dorssel.EntityFrameworkCore.Sqlite.Timestamp --version 8.0.3
#r "nuget: Dorssel.EntityFrameworkCore.Sqlite.Timestamp, 8.0.3"
#:package Dorssel.EntityFrameworkCore.Sqlite.Timestamp@8.0.3
#addin nuget:?package=Dorssel.EntityFrameworkCore.Sqlite.Timestamp&version=8.0.3
#tool nuget:?package=Dorssel.EntityFrameworkCore.Sqlite.Timestamp&version=8.0.3
dotnet-ef-sqlite-timestamp
Extension for Entity Framework (EF) Core (version 8.0 or higher) that adds support for SQLite row versioning ([Timestamp] attribute).
The implementation is for AnyCPU, and works on all platforms.
Usage
Add a package reference to your project for
Dorssel.EntityFrameworkCore.Sqlite.Timestamp,
next to an explicit reference to the required version of SQLite.
For EF Core X (with X = 8, 9, 10, or 11):
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="X.*" />
+ <PackageReference Include="Dorssel.EntityFrameworkCore.Sqlite.Timestamp" Version="*" />
It is not recommended to solely rely on the transitive dependency on Microsoft.EntityFrameworkCore.Sqlite,
as that would use the version at the time Dorssel.EntityFrameworkCore.Sqlite.Timestamp was built
instead of the latest one. Therefore, always add an explicit package reference for Microsoft.EntityFrameworkCore.Sqlite
in your project as well.
In your DbContext derived class modify the following:
+ using Dorssel.EntityFrameworkCore;
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder
.UseSqlite($"Data Source={DbPath}")
+ .UseSqliteTimestamp();
}
This is all you need to support row versioning with SQLite, including support for migrations.
See Native database-generated concurrency tokens; except now you can ignore the part that says it isn't supported with SQLite!
Example
See the Example project for a demonstration using .NET 11 & EF Core 11.
NuGet package
The released NuGet package and the .NET assemblies contained therein have the following properties:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.EntityFrameworkCore.Sqlite (>= 8.0.34)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Dorssel.EntityFrameworkCore.Sqlite.Timestamp:
| Package | Downloads |
|---|---|
|
Ternary.Data.SqlLite
A framework to simplify working with data from multiple sources, including files, databases and APIs. |
GitHub repositories
This package is not used by any popular GitHub repositories.