Exemplo n.º 1
0
            public override void Execute(ICommandContext context)
            {
                var root = context.TryLoad <SomeRoot>(SomeId)
                           ?? context.Create <SomeRoot>(SomeId);

                root.PossiblyDoSomething();
            }
Exemplo n.º 2
0
 public override void Execute(ICommandContext context)
 {
     var potato = context.TryLoad<Potato>(PotatoId)
                  ?? context.Create<Potato>(PotatoId);
     
     potato.Bite(FractionToBiteOff);
 }
Exemplo n.º 3
0
        public override void Execute(ICommandContext context)
        {
            var potato = context.TryLoad <Potato>(PotatoId)
                         ?? context.Create <Potato>(PotatoId);

            potato.Bite(FractionToBiteOff);
        }
Exemplo n.º 4
0
            public override void Execute(ICommandContext context)
            {
                var root = context.TryLoad<SomeRoot>(SomeId)
                           ?? context.Create<SomeRoot>(SomeId);

                root.PossiblyDoSomething();
            }
Exemplo n.º 5
0
            public override void Execute(ICommandContext context)
            {
                foreach (var id in Ids)
                {
                    var root = context.TryLoad <Root>(id)
                               ?? context.Create <Root>(id);

                    root.Act();
                }
            }
Exemplo n.º 6
0
 public override void Execute(ICommandContext context)
 {
     context.Create <Root>("root1").DoStuff();
     context.Create <Root>("root2").DoStuff();
 }
Exemplo n.º 7
0
 public override void Execute(ICommandContext context)
 {
     context
     .Create <Root>("root1")
     .MakeOtherRootDoStuff();
 }
 public override void Execute(ICommandContext context)
 {
     AggregateRootIds.Select(x => (context.TryLoad <MyRoot>(x) ?? context.Create <MyRoot>(x))).ToList().ForEach(r => r.EmitMyEvent());
     AggregateRootIds.Select(x => (context.TryLoad <MyRoot>(x) ?? context.Create <MyRoot>(x))).ToList().ForEach(r => r.EmitMyEvent());
 }