CQRS_Simple/CQRS_Simple.Infrastructure/IDomainEvent.cs

33 lines
694 B
C#
Raw Normal View History

2022-04-07 14:00:58 +08:00
using System;
namespace CQRS_Simple.Infrastructure
{
public class DomainEvent : IDomainEvent
{
/// <summary>
/// The time when the event occurred.
/// </summary>
public DateTime EventTime { get; set; }
/// <summary>
/// The object which triggers the event (optional).
/// </summary>
public object EventSource { get; set; }
/// <summary>
/// Constructor.
/// </summary>
protected DomainEvent()
{
EventTime = DateTime.Now;
}
}
public interface IDomainEvent
{
DateTime EventTime { get; }
object EventSource { get; set; }
}
}