Entity Framework Plus Audit - Data Annotations
Problem
You want to use DataAnnotations.
Solution
Following DataAnnotations is available:
- AuditDisplay
- AuditExclude
- AuditInclude
However, in order to make them work, you must enable DataAnnotations
Example Class
[AuditInclude] [AuditDisplay("MyCustomEntityName")] public class EntitySimple : IEntitySimple { [AuditDisplay("MyCustomPropertyTable")] public int CompanyId { get; set; } [AuditExclude] public int Column1 { get; set;} }
Example Enable DataAnnotations
AuditManager.DefaultConfiguration.ExcludeDataAnnotation(); AuditManager.DefaultConfiguration.DataAnnotationDisplayName();