// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System; using Squidex.Infrastructure.EventSourcing; namespace Squidex.Infrastructure.States { public delegate bool HandleEvent(Envelope @event); public delegate void HandleSnapshot(T state); public interface IPersistenceFactory { IPersistence WithEventSourcing(Type owner, DomainId id, HandleEvent? applyEvent); IPersistence WithSnapshots(Type owner, DomainId id, HandleSnapshot? applySnapshot); IPersistence WithSnapshotsAndEventSourcing(Type owner, DomainId id, HandleSnapshot? applySnapshot, HandleEvent? applyEvent); } }