Ejemplo n.º 1
0
        internal CommandExecutionResult Execute(CommandInstance cmd)
        {
            var evt  = Model.Method.Invoke(Instance.Object, new[] { cmd.Instance });
            var list = new List <DomainEventInstance>();

            list.Add(new DomainEventInstance(evt));
            return(new CommandExecutionResult(list));
        }
Ejemplo n.º 2
0
        public CommandExecutionResult Execute(CommandInstance cmd)
        {
            CommandHandlerInstance handler = null;

            if (Factory.Handles(cmd))
            {
                handler = Factory;
            }
            else
            {
                handler = CommandHandlers.Single(c => c.Handles(cmd));
            }

            return(handler.Execute(cmd));
        }
Ejemplo n.º 3
0
 public bool Handles(CommandInstance instance)
 {
     return(Model.Handles(instance.Model));
 }