Alkanzi.Auditable 1.0.1

dotnet add package Alkanzi.Auditable --version 1.0.1
                    
NuGet\Install-Package Alkanzi.Auditable -Version 1.0.1
                    
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="Alkanzi.Auditable" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alkanzi.Auditable" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Alkanzi.Auditable" />
                    
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 Alkanzi.Auditable --version 1.0.1
                    
#r "nuget: Alkanzi.Auditable, 1.0.1"
                    
#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 Alkanzi.Auditable@1.0.1
                    
#: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=Alkanzi.Auditable&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Alkanzi.Auditable&version=1.0.1
                    
Install as a Cake Tool

Alkanzi.Auditable

A lightweight, interface-based contract for audit-stamping entities (Created/Updated/Deleted metadata) — designed to work with any existing base class, no inheritance required.

Requirements

Requires .NET 8.0 or later (uses C# default interface methods — not compatible with .NET Standard 2.0 or .NET Framework).

Install

dotnet add package Alkanzi.Auditable

Usage

Implement IAuditable on your entity — no base class required, works alongside any existing inheritance:

public class Budget : IAuditable
{
    public bool IS_UPDATED { get; set; }
    public bool IS_DELETED { get; set; }
    public int CREATED_BY { get; set; }
    public int? UPDATED_BY { get; set; }
    public int? DELETED_BY { get; set; }
    public DateTime CREATED_AT { get; set; }
    public DateTime? UPDATED_AT { get; set; }
    public DateTime? DELETED_AT { get; set; }
}

Because MarkCreated, MarkUpdated, and MarkDeleted are default interface methods, call them through the IAuditable type — not directly on the concrete class:

var budget = new Budget();

((IAuditable)budget).MarkCreated(userId: 42);

Or, if you already have a variable typed as the interface (common in service/repository code):

IAuditable auditable = budget;
auditable.MarkCreated(42);
auditable.MarkUpdated(7);
auditable.MarkDeleted(3);

Why an interface, not a base class?

Your entities may already inherit from your own Base.cs or ORM base type. IAuditable works alongside that — just implement it, no multiple-inheritance conflicts.

Why call through the interface?

Default interface methods are only accessible via the interface type, not the implementing class directly. This is a C# language rule (not specific to this package) — casting or declaring the variable as IAuditable resolves it.

Product 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 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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

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
1.0.1 135 7/20/2026
1.0.0 116 7/19/2026