using System;

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

        public SimplifyAuditingLogAttribute(int maxLengthAllowed = 1024) => MaxLengthAllowed = maxLengthAllowed;
    }
}