Exemplo n.º 1
0
        public static void Using <TEvent, TProjection, TContext>(
            this ICreateAction <TEvent, TProjection, TContext> action,
            Func <TProjection, TEvent, Task> projector)
        {
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }

            if (projector == null)
            {
                throw new ArgumentNullException(nameof(projector));
            }

            action.Using((projection, anEvent, context) => projector(projection, anEvent));
        }
Exemplo n.º 2
0
        public static void Using <TEvent, TProjection, TContext>(
            this ICreateAction <TEvent, TProjection, TContext> action,
            Action <TProjection, TEvent> projector)
        {
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }

            if (projector == null)
            {
                throw new ArgumentNullException(nameof(projector));
            }

            action.Using((projection, anEvent, context) =>
            {
                projector(projection, anEvent);
                return(TaskConstants.FalseTask);
            });
        }