first commit

This commit is contained in:
yanpeng200212
2026-10-08 10:43:59 +08:00
commit 8430ba0452
288 changed files with 29595 additions and 0 deletions
@@ -0,0 +1,21 @@
namespace F9WebAiTest.Domain.Entities;
/// <summary>
/// DDD 聚合根基类:BusinessEntity + 领域事件。
/// 聚合根是聚合的入口与唯一代表,外部只能通过聚合根访问聚合内部对象,通过仓储持久化。
/// 参考 BBIT.F9.Domain.Entities.AggregateRoot
/// </summary>
public abstract class AggregateRoot : BusinessEntity, IAggregateRoot
{
private readonly List<IDomainEvent> _domainEvents = new();
public IReadOnlyCollection<IDomainEvent> DomainEvents => _domainEvents.AsReadOnly();
protected void AddDomainEvent(IDomainEvent domainEvent) => _domainEvents.Add(domainEvent);
public void ClearDomainEvents() => _domainEvents.Clear();
}
/// <summary>聚合根标记接口</summary>
public interface IAggregateRoot
{
}