Пример #1
0
        public Validation <IError, StoreModel> Handle(StoreCreateCommand input)
        {
            // validate
            // create domain model
            var store = new Store();

            // interrupt
            DispatchCreating(store);
            // TODO: use bind next

            // call store service, in order to save it
            // throw async Event
            // use async message bus (persist event ?)
            // return successful result
            return(new Validation <IError, StoreModel>());
        }
Пример #2
0
        // proxy methods
        public Validation <IError, StoreModel> Create(StoreCreateCommand command)
        {
            // TODO: call first createUseCaseHandlers put command
            // TODO: call next createUseCaseHandlers put command
            // TODO: call real method
            //var current = IUseCaseHandler<StoreCreateCommand, Validation<IError, StoreModel>>(this);
            //var g = IUseCaseHandler<StoreCreateCommand, Validation<IError, StoreModel>>.Handle(command);

            //createUseCaseHandlers.Aggregate((command, (Validation<IError, StoreModel>)null), (arguments, handler) => (arguments.Item1, handler.Handle(arguments.Item1)));

            //var stepCommand = command;
            //Validation<IError, StoreModel> result;
            //foreach (var useCaseHandler in createUseCaseHandlers)
            //{
            //    result = useCaseHandler.Handle(stepCommand);
            //}

            //return result;

            throw new System.NotImplementedException();
        }
Пример #3
0
        public Validation <IError, StoreModel> Create(StoreCreateCommand command)
        {
            // validate
            // create domain model
            var store = new Store();
            // interrupt
            var args = new CreateArguments();
            var i    = new StoreCreatingInterrupterModel(store, args);
            //var g = storeCreateInterrupters.Aggregate(i, (model, interrupter) => InterrupterDispatcher.Dispatch(interrupter, model));
            var iResult = InterrupterDispatcher.Dispatch(storeCreateInterrupters, i);

            if (iResult.Arguments.IsCanceled)
            {
                // TODO: return reason
                //Fail(args.Reason)
                return(null);
            }

            // call store service, in order to save it
            // throw async Event

            // return successful result
            return(new Validation <IError, StoreModel>());
        }
Пример #4
0
 public Validation <IError, StoreModel> Handle(StoreCreateCommand input)
 {
     throw new System.NotImplementedException();
 }
Пример #5
0
 public Validation <IError, StoreModel> Create(StoreCreateCommand command) => storeCreateCommandHandler.Handle(command);
Пример #6
0
 public Validation <IError, StoreModel> Handle(StoreCreateCommand input)
 {
     return(decoratee.Handle(input));
 }
Пример #7
0
 Validation <IError, IEnumerable <StoreModel> > IUseCaseHandler <StoreCreateCommand, Validation <IError, IEnumerable <StoreModel> > > .Handle(StoreCreateCommand input)
 {
     throw new System.NotImplementedException();
 }