예제 #1
0
                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);
                    }
                }
예제 #2
0
 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;
 }
예제 #3
0
        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);
        }
예제 #4
0
 public ProjectorBuilder <TJournal, TProjection, TProjectionId, TProjectionContext> WithProjectorBuilder(
     ProjectorMap <TProjection, TProjectionId, TProjectionContext> projectorMap)
 {
     ProjectorMap = projectorMap;
     return(this);
 }