mirror of
https://github.com/farcasclaudiu/PracticeCalendar.git
synced 2026-06-28 13:01:04 +03:00
Add project files.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user