Tolitech.Auditing.Generators.Abstractions
1.0.0
See the version list below for details.
dotnet add package Tolitech.Auditing.Generators.Abstractions --version 1.0.0
NuGet\Install-Package Tolitech.Auditing.Generators.Abstractions -Version 1.0.0
<PackageReference Include="Tolitech.Auditing.Generators.Abstractions" Version="1.0.0" />
<PackageVersion Include="Tolitech.Auditing.Generators.Abstractions" Version="1.0.0" />
<PackageReference Include="Tolitech.Auditing.Generators.Abstractions" />
paket add Tolitech.Auditing.Generators.Abstractions --version 1.0.0
#r "nuget: Tolitech.Auditing.Generators.Abstractions, 1.0.0"
#:package Tolitech.Auditing.Generators.Abstractions@1.0.0
#addin nuget:?package=Tolitech.Auditing.Generators.Abstractions&version=1.0.0
#tool nuget:?package=Tolitech.Auditing.Generators.Abstractions&version=1.0.0
Tolitech.Auditing.Generators.Abstractions
Contracts and attributes used by Tolitech.Auditing.Generators.
This package does not implement audit logic by itself. It provides marker interfaces and property attributes so each application can define its own audit contract names.
Marker Interfaces
ICreatedAuditICreatedAudit<TUserId>IUpdatedAuditIUpdatedAudit<TUserId>IDeletedAuditIDeletedAudit<TUserId>
The interfaces intentionally do not expose SetCreatedAudit, SetUpdatedAudit, or SetDeletedAudit. Those methods are generated as private methods inside the audited entity by the source generator.
Property Attributes
[CreatedAtAudit][CreatedByAudit][UpdatedAtAudit][UpdatedByAudit][IsDeletedAudit][DeletedAtAudit][DeletedByAudit]
Use these attributes on properties declared by your application-level interfaces.
using Tolitech.Auditing.Generators.Abstractions;
namespace MyProject.Shared.Domain.Abstractions.Audit;
public interface ICreatedAudit : Tolitech.Auditing.Generators.Abstractions.ICreatedAudit
{
[CreatedAtAudit]
DateTimeOffset? CreatedAt { get; }
}
public interface ICreatedAudit<TUserId> :
ICreatedAudit,
Tolitech.Auditing.Generators.Abstractions.ICreatedAudit<TUserId>
where TUserId : struct
{
[CreatedByAudit]
TUserId? CreatedById { get; }
}
Custom Property Names
The property names belong to your project. For example, one project can use CreatedAt, while another can use CriadoEm.
public interface IAuditoriaCriacao : Tolitech.Auditing.Generators.Abstractions.ICreatedAudit
{
[CreatedAtAudit]
DateTimeOffset? CriadoEm { get; }
}
Generated Methods
The generator creates private methods in the audited entity, such as:
private IResult SetCreatedAudit(UserId? createdById)
Because the generated methods are private, only the entity itself can call them. External code cannot call entity.SetCreatedAudit(...) unless the entity author explicitly declares a public method manually.
| Product | Versions 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. |
-
net10.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.