mirror of
https://github.com/farcasclaudiu/PracticeCalendar.git
synced 2026-06-22 13:01:22 +03:00
17 lines
532 B
C#
17 lines
532 B
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace PracticeCalendar.Domain.Common
|
|
{
|
|
public abstract class EntityBase
|
|
{
|
|
public int Id { get; set; }
|
|
|
|
private List<DomainEventBase> _domainEvents = new();
|
|
[NotMapped]
|
|
public IEnumerable<DomainEventBase> DomainEvents => _domainEvents.AsReadOnly();
|
|
|
|
protected void RegisterDomainEvent(DomainEventBase domainEvent) => _domainEvents.Add(domainEvent);
|
|
internal void ClearDomainEvents() => _domainEvents.Clear();
|
|
}
|
|
}
|