Guler.Editor.Premium.Audit.EfCore
0.2.0-alpha.0
dotnet add package Guler.Editor.Premium.Audit.EfCore --version 0.2.0-alpha.0
NuGet\Install-Package Guler.Editor.Premium.Audit.EfCore -Version 0.2.0-alpha.0
<PackageReference Include="Guler.Editor.Premium.Audit.EfCore" Version="0.2.0-alpha.0" />
<PackageVersion Include="Guler.Editor.Premium.Audit.EfCore" Version="0.2.0-alpha.0" />
<PackageReference Include="Guler.Editor.Premium.Audit.EfCore" />
paket add Guler.Editor.Premium.Audit.EfCore --version 0.2.0-alpha.0
#r "nuget: Guler.Editor.Premium.Audit.EfCore, 0.2.0-alpha.0"
#:package Guler.Editor.Premium.Audit.EfCore@0.2.0-alpha.0
#addin nuget:?package=Guler.Editor.Premium.Audit.EfCore&version=0.2.0-alpha.0&prerelease
#tool nuget:?package=Guler.Editor.Premium.Audit.EfCore&version=0.2.0-alpha.0&prerelease
Stylus.Premium.Audit.EfCore
Production-grade persistent IStylusAuditStore implementation for Stylus.Premium.Audit — EF Core 8 backed.
Sprint 7 yan paketi (ADR-011 §Sonraki Adımlar Faz 5 candidate). Stylus.Premium.Audit'in
InMemoryAuditStoredefault'unu pilot/production'da değiştirir.
Kurulum
public class MyDbContext : DbContext
{
public MyDbContext(DbContextOptions<MyDbContext> options) : base(options) { }
public DbSet<StylusAuditVersion> StylusAuditVersions => Set<StylusAuditVersion>();
protected override void OnModelCreating(ModelBuilder mb)
{
// Stylus audit tablo şemasını otomatik konfigüre et
mb.ApplyStylusAuditConfiguration();
}
}
// Program.cs
builder.Services.AddDbContext<MyDbContext>(opts =>
opts.UseSqlite("Data Source=app.db"));
builder.Services.AddStylusPremium(license: cfg["Stylus:LicenseKey"]);
builder.Services.AddStylusAudit(opts => opts.RetentionDays = 90);
builder.Services.AddStylusAuditEfCore<MyDbContext>(); // ← bu paket
AddStylusAuditEfCore<TContext>() çağrısı:
IStylusAuditStoreregistration'ınıEfCoreAuditStore<TContext>ile override eder (ana paketinInMemoryAuditStoredefault'unu değiştirir)- TContext'in
DbSet<StylusAuditVersion>propertysi'ne erişebilmesi için marker interface yok — Stylus EF Core internal Context resolution kullanır
Migration
dotnet ef migrations add AddStylusAudit
dotnet ef database update
Veya programmatic:
using var scope = app.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<MyDbContext>();
db.Database.Migrate();
Schema
Tek tablo: StylusAuditVersions
Id(long, PK, identity)ContentKey(string, indexed)VersionNumber(int)Html(text)UserId(string)Title(string, nullable)Timestamp(DateTimeOffset, indexed)
Composite unique index: (ContentKey, VersionNumber) — concurrent save'lerde çakışma koruması.
Atomik VersionNumber
InMemoryAuditStore Interlocked.Increment ile atomik artırma yapıyor; EF Core'da bu mümkün değil (multi-instance concurrent insert race condition). Çözüm:
(ContentKey, VersionNumber)UNIQUE INDEX- INSERT öncesi
MAX(VersionNumber) + 1SELECT (transaction içinde) - DbUpdateException UNIQUE violation yakalandığında 1 retry
Production'da SERIALIZABLE isolation level + retry policy ek güvence.
Tests
tests/Stylus.Premium.Audit.EfCore.Tests/ — Microsoft.EntityFrameworkCore.Sqlite in-memory ile.
İlgili kaynaklar
| 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
- Guler.Editor.Core (>= 0.2.0-alpha.0)
- Guler.Editor.Licensing (>= 0.2.0-alpha.0)
- Guler.Editor.Premium.Audit (>= 0.2.0-alpha.0)
- Microsoft.EntityFrameworkCore (>= 8.0.10)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.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 |
|---|---|---|
| 0.2.0-alpha.0 | 81 | 5/1/2026 |