Init
This commit is contained in:
22
Prefab/Domain/Common/Event.cs
Normal file
22
Prefab/Domain/Common/Event.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Prefab.Base;
|
||||
|
||||
namespace Prefab.Domain.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Base type for domain events captured during aggregate processing.
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public abstract record Event : IEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the event has been dispatched to external transports.
|
||||
/// </summary>
|
||||
public bool IsPublished { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the timestamp for when the event occurred.
|
||||
/// </summary>
|
||||
public DateTimeOffset DateOccurred { get; protected set; } = DateTimeOffset.UtcNow;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user