public void EnqueueDelete(StreamFragment <TDoc, TId> fragment) { var deletion = _storage.DeleteForId(fragment.Id); _enqueueOperations.Post(deletion); }
// This is what would be generated. public abstract ValueTask <IStorageOperation> ResolveOperation(StreamFragment <TDoc, TId> fragment);
public virtual bool IsNew(StreamFragment <TDoc, TId> fragment) { return(fragment.Events.First().Version == 1); }
public abstract IStorageOperation DetermineOperationSync(IMartenSession session, StreamFragment <TDoc, TId> fragment);
public Task <IStorageOperation> DetermineOperation(IMartenSession session, StreamFragment <TDoc, TId> fragment, CancellationToken cancellation) { return(Task.FromResult(DetermineOperationSync(session, fragment))); }
public bool WillDelete(StreamFragment <TDoc, TId> fragment) { return(_projection.MatchesAnyDeleteType(fragment)); }
public abstract Task <IStorageOperation> DetermineOperation(IMartenSession session, StreamFragment <TDoc, TId> fragment, CancellationToken cancellation);