mirror of
https://github.com/farcasclaudiu/PracticeCalendar.git
synced 2026-06-22 09:01:18 +03:00
refactoring and integration tests
This commit is contained in:
@@ -3,5 +3,6 @@
|
||||
public class DomainEventBase
|
||||
{
|
||||
public DateTime EventDate { get; protected set; } = DateTime.UtcNow;
|
||||
public bool IsPublished { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using MediatR;
|
||||
|
||||
namespace PracticeCalendar.Domain.Common
|
||||
{
|
||||
public class DomainEventNotification<TDomainEvent> : INotification where TDomainEvent : DomainEventBase
|
||||
{
|
||||
public TDomainEvent DomainEvent { get; }
|
||||
|
||||
public DomainEventNotification(TDomainEvent domainEvent)
|
||||
{
|
||||
DomainEvent = domainEvent;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace PracticeCalendar.Domain.Common.Interfaces
|
||||
{
|
||||
public interface IDomainEventService
|
||||
{
|
||||
Task Publish(DomainEventBase domainEvent);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user