Newer
Older
SlimDomainModel / Events.cs
@Derek Comartin Derek Comartin on 19 Sep 2023 627 bytes Init
using System;

namespace EventSourcing.Demo
{
    public interface IEvent
    {
        string EventType { get; }
    }

    public record ProductShipped(string Sku, int Quantity, DateTime DateTime) : IEvent
    {
        public string EventType { get; } = "ProductShipped";
    }

    public record ProductReceived(string Sku, int Quantity, DateTime DateTime) : IEvent
    {
        public string EventType { get; } = "ProductReceived";
    }

    public record InventoryAdjusted(string Sku, int Quantity, string Reason, DateTime DateTime) : IEvent
    {
        public string EventType { get; } = "InventoryAdjusted";
    }
}