refactoring and integration tests

This commit is contained in:
2022-10-10 04:02:46 +03:00
parent 28a6981001
commit ec54d2c255
15 changed files with 172 additions and 7 deletions
@@ -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);
}
}