SimplifyAuditingLogAttribute.cs 581 B

12345678910111213
  1. using System;
  2. namespace VCommon.VApplication.Auditing.DataAnnotations
  3. {
  4. /// <summary> 简化写入审计日志, 当序列化结果超过指定值时,简化信息并带上类名 如集合只保留个数,字符串只保留长度 </summary>
  5. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field)]
  6. public sealed class SimplifyAuditingLogAttribute : Attribute
  7. {
  8. public int MaxLengthAllowed { get; }
  9. public SimplifyAuditingLogAttribute(int maxLengthAllowed = 1024) => MaxLengthAllowed = maxLengthAllowed;
  10. }
  11. }