BccCode.Privacy.ChangeHistory 12.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package BccCode.Privacy.ChangeHistory --version 12.0.0
                    
NuGet\Install-Package BccCode.Privacy.ChangeHistory -Version 12.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BccCode.Privacy.ChangeHistory" Version="12.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BccCode.Privacy.ChangeHistory" Version="12.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BccCode.Privacy.ChangeHistory" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BccCode.Privacy.ChangeHistory --version 12.0.0
                    
#r "nuget: BccCode.Privacy.ChangeHistory, 12.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BccCode.Privacy.ChangeHistory@12.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BccCode.Privacy.ChangeHistory&version=12.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BccCode.Privacy.ChangeHistory&version=12.0.0
                    
Install as a Cake Tool

BccCode.Privacy.ChangeHistory

Connects BccCode.Privacy.EntityFrameworkCore and BccCode.ChangeHistory on one model, so events, links, changes and history versions are read per org, like the current rows. Hosting's AddPrivacy registers it; without Hosting:

services.AddChangeHistory<AppDbContext>(o => o.UseNpgsql(connectionString));   // or AddDbContext
services.AddPrivacyEntityFrameworkCore<AppDbContext>(models);
services.AddPrivacyChangeHistory();

AddPrivacyChangeHistory():

  • registers ChangeHistory's reader scope, PrivacyEventReaderScope: the orgs of the scope's PrivacyContext. A reader sees an event, its payload and trace only when all its links belong to those orgs (FilterEventsByOrganisation()); an event that spans orgs, or has a link without an owner, is read only with IgnoreQueryFilters() (maintenance). No orgs: no events;
  • turns on FilterHistoryByCurrentRow(): history versions are read only while the current row passes the privacy filter;
  • makes each personal entity's org its events' owner (HasEventOwner); a child entity's events belong to its parent's org, through the navigation to the parent;
  • keeps the privacy columns (allowed_processes, person_link, last_reduced_at) out of versioning, so the derivation and the privacy job's reductions write no history version, and gives the privacy job a row writer that rewrites history too.

Hosting checks at start-up that a ChangeHistory context reads events through PrivacyEventReaderScope.

In a mixed or ownerless event, Changes() and ChangesFor() keep the change to the reader's own row, with the event's name, actor and reason left empty.

Deleted rows

By default the history of a deleted row is hidden, as the row is. IncludeDeleted() opts one read in, for retract, undo and the audit of deletions:

var versions = await db.History.IncludeDeleted().Versions<Member>().Where(v => v.Entity.Id == id).ToListAsync();
await using var past = await db.History.IncludeDeleted().AsOfAsync(before);

A deleted row is shown only when the privacy filter passes on its last version: the row was one of the context's orgs', and its allowed_processes held the context's process when it was deleted. Another organisation never sees it, and IgnoreQueryFilters() is not needed (it would drop both checks).

Versions tested

BccCode.ChangeHistory 0.6.80 from nuget.org, the version Directory.Packages.props pins (0.6.80 adds HasEventOwner through a parent navigation). Versions 0.4.43 to 0.4.63 are partial releases; do not use them.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
14.6.8 38 11/26/2026
14.6.7 41 11/26/2026
14.6.6 41 11/26/2026
14.6.5 44 11/26/2026
14.6.4 43 11/26/2026
14.6.3 46 11/26/2026
14.6.2 40 11/26/2026
14.6.1 47 11/26/2026
14.6.0 41 11/26/2026
14.5.0 37 11/26/2026
14.4.0 45 11/26/2026
14.3.0 38 11/26/2026
14.2.0 40 11/26/2026
14.1.1 44 11/26/2026
14.1.0 39 11/26/2026
14.0.1 34 11/26/2026
14.0.0 42 11/26/2026
13.0.0 39 11/26/2026
12.0.1 38 11/26/2026
12.0.0 46 11/26/2026
Loading failed