namespace NetAdmin.Domain.Events; /// /// Sql命令事件 /// public abstract record SqlCommandEvent : DataAbstraction, IEventSource { /// /// Initializes a new instance of the class. /// protected SqlCommandEvent(bool isConsumOnce = false) { IsConsumOnce = isConsumOnce; } /// public bool IsConsumOnce { get; } /// public CancellationToken CancellationToken { get; init; } /// public DateTime CreatedTime { get; protected init; } /// public string EventId { get; protected init; } /// public object Payload { get; init; } /// /// 标识符缩写 /// protected string Id => Identifier.ToString()[..8].ToUpperInvariant(); /// /// 标识符,可将 CommandBefore 与 CommandAfter 进行匹配 /// protected Guid Identifier { get; init; } /// /// 关联的Sql语句 /// protected string Sql { get; init; } }