23 lines
623 B
C#
23 lines
623 B
C#
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;
|
|
}
|
|
|