Пример #1
0
        public ICommandHandlerResult Execute(Commands.ICommandContext context, TestMyCommand command)
        {
            var root = context.GetAggregateRoot <Guid, TestAggregateRoot>(Guid.NewGuid(), () => new TestAggregateRoot());

            Console.WriteLine("this command is test my command");
            return(context.CreateResult(CommandHandlerStatus.Success));
        }
Пример #2
0
        public void TestTwoCommand()
        {
            var cmd1       = new TestCommand();
            var cmd2       = new TestMyCommand();
            var commandBus = ContainerContext.Current.ServiceLocator.Resolve <ICommandBus>();

            commandBus.Send(cmd1, null);
            Console.ReadLine();
        }