0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-30 02:31:08 +00:00
CleanArchitecture/CleanArchitecture.Domain/DomainEvents/Message.cs
2023-08-31 18:19:17 +02:00

22 lines
517 B
C#

using System;
using MediatR;
namespace CleanArchitecture.Domain.DomainEvents;
public abstract class Message : IRequest
{
public Guid AggregateId { get; private set; }
public string MessageType { get; protected set; }
protected Message(Guid aggregateId)
{
AggregateId = aggregateId;
MessageType = GetType().Name;
}
protected Message(Guid aggregateId, string? messageType)
{
AggregateId = aggregateId;
MessageType = messageType ?? string.Empty;
}
}