0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-29 18:21:08 +00:00
CleanArchitecture/CleanArchitecture.Domain/Notifications/DomainNotification.cs
2023-09-02 12:32:36 +02:00

28 lines
782 B
C#

using System;
using CleanArchitecture.Shared.Events;
namespace CleanArchitecture.Domain.Notifications;
public class DomainNotification : DomainEvent
{
public string Key { get; }
public string Value { get; }
public string Code { get; }
public object? Data { get; set; }
public int Version { get; private set; } = 1;
public DomainNotification(
string key,
string value,
string code,
object? data = null,
Guid? aggregateId = null)
: base(aggregateId ?? Guid.Empty)
{
Key = key ?? throw new ArgumentNullException(nameof(key));
Value = value ?? throw new ArgumentNullException(nameof(value));
Code = code ?? throw new ArgumentNullException(nameof(code));
Data = data;
}
}