Skip to content

Audit pattern

arbinada-com edited this page Apr 23, 2020 · 1 revision

Audit pattern provide the information for both object creator and last editor with corresponding dates.

Audit pattern add following attributes to all entities and underlying tables:

  • CreatedBy
  • CreationDate
  • LastModifiedBy
  • LastModifiedDate

Attributes CreatedBy and LastModifiedBy contains the identity name for the current principal of thread/process which has created the object or made its modifications.

Configuration example

<Pattern name="Audit">
</Pattern>

Configuration parameters

Actually, there are no parameters.

Use case code exemple

Currency currency = new Currency();
currency.Code = "USD";
currency.Name = "US dollar";
currency.Save();
Console.WriteLine("Currency '{0}' was created at {1} by {2}",
	currency.Code,
	currency.CreationDate,
	currency.CreatedBy);

Clone this wiki locally