private async Task OnDelete(ProjectorMap <TProjection, TProjectionId, TProjectionContext> projector, Func <TEvent, TProjectionId> getKey, TEvent anEvent, TProjectionContext context) { var key = getKey(anEvent); var deleted = await projector.Delete(key, context); if (!deleted) { _handleMissing(key, context); } }
public ProjectorBuilder( TJournal journal, ProjectorMap <TProjection, TProjectionId, TProjectionContext> projectorMap, EventMapBuilder <TProjection, TProjectionId, TProjectionContext> eventMapBuilder, string name, ActorSystem actorSystem) : base(journal, name, actorSystem) { ProjectorMap = projectorMap; EventMapBuilder = eventMapBuilder; }
public IEventMap <TProjectionContext> Build(ProjectorMap <TProjectionContext> projector) { AssertNotBuilt(); if (projector == null) { throw new ArgumentNullException(nameof(projector)); } if (projector.Custom == null) { throw new ArgumentException( $"Expected the Custom property to point to a valid instance of {nameof(CustomHandler<TProjectionContext>)}", nameof(projector)); } this._projector = projector; return(_eventMap); }
public ProjectorBuilder <TJournal, TProjection, TProjectionId, TProjectionContext> WithProjectorBuilder( ProjectorMap <TProjection, TProjectionId, TProjectionContext> projectorMap) { ProjectorMap = projectorMap; return(this); }