Example #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));
        }
Example #2
0
        public ICommandHandlerResult Execute(Commands.ICommandContext context, TestCommand command)
        {
            //System.Threading.Interlocked.Increment(ref TestCQRS.inter);

            //Console.WriteLine("this command is test command");
            var root = context.GetAggregateRoot(2L, () => { return(new TestAggregateRoot()
                {
                }); });

            //context.WriteEvent(new[] { new TestEvent1() }, command);
            //context.WriteEvent(new[] { new TestEvent1() }, command);
            //var t = context.Flush();
            return(context.CreateResult(CommandHandlerStatus.Success));
            // eventBus.AsyncPublish(context, new TestEvent1());
        }