Ling.Audit 1.1.0

dotnet add package Ling.Audit --version 1.1.0
NuGet\Install-Package Ling.Audit -Version 1.1.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="Ling.Audit" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ling.Audit --version 1.1.0
#r "nuget: Ling.Audit, 1.1.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.
// Install Ling.Audit as a Cake Addin
#addin nuget:?package=Ling.Audit&version=1.1.0

// Install Ling.Audit as a Cake Tool
#tool nuget:?package=Ling.Audit&version=1.1.0

Ling.Audit

Introduction

Ling.Audit is a source generator for audit properties.

Installation

You can install Ling.Audit using either Package Manager or .NET CLI.

  1. Package Manager
PM> Install-Package Ling.Audit
  1. .NET CLI
dotnet add package Ling.Audit

Usage

To use Ling.Audit, follow these steps:

  1. Create your class with the partial keyword and implement the necessary interfaces:
  • IHasCreationTime
  • IHasCreator<T>
  • ICreationAudited<T>
  • IHasModificationTime
  • IHasModifier<T>
  • IModificationAudited<T>
  • ISoftDelete
  • IHasDeletionTime
  • IHasDeleter<T>
  • IDeletionAudited<T>
  • IFullAudited<T>

Here's an example of how to implement these interfaces in a class called Post:

public partial class Post : IFullAudited<Guid>
{
	public int Id { get; set; }
	public string Title { get; set; } = null!;
	...
}

This will generate the following properties for the Post class:

// <auto-generated/>

#nullable enable annotations
#nullable disable warnings

namespace WebApplication1.Entities
{
    public partial class Post
    {
        /// <summary>
        /// Gets or sets the creation time of this entity.
        /// </summary>
        public virtual global::System.DateTimeOffset CreationTime { get; set; }
    
        /// <summary>
        /// Gets or sets the creator Id of this entity.
        /// </summary>
        public virtual global::System.Nullable<global::System.Guid> CreatorId { get; set; }
    
        /// <summary>
        /// Gets or sets the last modification time of this entity.
        /// </summary>
        public virtual global::System.Nullable<global::System.DateTimeOffset> LastModificationTime { get; set; }
    
        /// <summary>
        /// Gets or sets the last modifier Id of this entity.
        /// </summary>
        public virtual global::System.Nullable<global::System.Guid> LastModifierId { get; set; }
    
        /// <summary>
        /// Gets or sets whether this entity is soft deleted.
        /// </summary>
        public virtual global::System.Boolean IsDeleted { get; set; }
    
        /// <summary>
        /// Gets or sets the deletion time of this entity.
        /// </summary>
        public virtual global::System.Nullable<global::System.DateTimeOffset> DeletionTime { get; set; }
    
        /// <summary>
        /// Get or set the deleter Id of this entity.
        /// </summary>
        public virtual global::System.Nullable<global::System.Guid> DeleterId { get; set; }
    }
}
  1. If you are using EntityFrameworkCore, you can easily audit and save the entity to the database with Ling.EntityFrameworkCore.Audit.

License

This project is licensed under the Apache 2.0 license.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.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.1.0 208 12/9/2023
1.0.0 256 2/17/2023