// ========================================================================== // Envelope.cs // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex Group // All rights reserved. // ========================================================================== using System; using NodaTime; namespace Squidex.Infrastructure.CQRS.Events { public static class Envelope { public static Envelope Create(TPayload payload) where TPayload : IEvent { var eventId = Guid.NewGuid(); var envelope = new Envelope(payload) .SetEventId(eventId) .SetTimestamp(SystemClock.Instance.GetCurrentInstant()); return envelope; } } }