![]() |
VOOZH | about |
dotnet add package FrontLook.IAutoHistory --version 8.26.113.20
NuGet\Install-Package FrontLook.IAutoHistory -Version 8.26.113.20
<PackageReference Include="FrontLook.IAutoHistory" Version="8.26.113.20" />
<PackageVersion Include="FrontLook.IAutoHistory" Version="8.26.113.20" />Directory.Packages.props
<PackageReference Include="FrontLook.IAutoHistory" />Project file
paket add FrontLook.IAutoHistory --version 8.26.113.20
#r "nuget: FrontLook.IAutoHistory, 8.26.113.20"
#:package FrontLook.IAutoHistory@8.26.113.20
#addin nuget:?package=FrontLook.IAutoHistory&version=8.26.113.20Install as a Cake Addin
#tool nuget:?package=FrontLook.IAutoHistory&version=8.26.113.20Install as a Cake Tool
A plugin for Microsoft.EntityFrameworkCore to support automatically recording data changes history.
AutoHistory will recording all the data changing history in one Table named AutoHistories, this table will recording data
UPDATE, DELETE history.
Run the following command in the Package Manager Console to install Microsoft.EntityFrameworkCore.AutoHistory
PM> Install-Package Microsoft.EntityFrameworkCore.AutoHistory
public class BloggingContext : DbContext
{
public BloggingContext(DbContextOptions<BloggingContext> options)
: base(options)
{ }
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
// enable auto history functionality.
modelBuilder.EnableAutoHistory();
}
}
bloggingContext.EnsureAutoHistory()
You can use a custom auto history entity by extending the Microsoft.EntityFrameworkCore.AutoHistory class.
class CustomAutoHistory : AutoHistory
{
public String CustomField { get; set; }
}
Then register it in the db context like follows:
modelBuilder.EnableAutoHistory<CustomAutoHistory>(o => { });
Then provide a custom history entity creating factory when calling EnsureAutoHistory. The example shows using the
factory directly, but you should use a service here that fills out your history extended properties(The properties inherited from AutoHistory will be set by the framework automatically).
db.EnsureAutoHistory(() => new CustomAutoHistory()
{
CustomField = "CustomValue"
});
Microsoft.EntityFrameworkCore.UnitOfWork had integrated this package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on FrontLook.IAutoHistory:
| Package | Downloads |
|---|---|
|
FrontLookCoreLibraryAssembly.Hosting.DbContext
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.26.113.20 | 137 | 1/13/2026 |