public Modeling.Events.IEvent Handle(ExecutionCommandContext <MyCommand> context)
            {
                var a = new XExtendsBaseClass(DomainModel);

                a.Name = "Test";
                return(new MyEvent(DomainModel, context.CurrentSession.SessionId));
            }
Exemple #2
0
        Modeling.Events.IEvent ICommandHandler <NewLoanCommand> .Handle(ExecutionCommandContext <NewLoanCommand> context)
        {
            var loan = new Loan();

            loan.Member  = Member;
            loan.Book    = Book;
            Book.Copies -= 1;
            Member.Library.Loans.Add(loan);
            return(null);
        }
        public override BeforeContinuationStatus OnBeforeExecution(ExecutionCommandContext <NewLoanCommand> context)
        {
            if (context.Command.Member.Name.Contains("9"))
            {
                context.Log(new Modeling.DiagnosticMessage(Modeling.MessageType.Error, "Member 9 is not authorized to loan a book.", "Error"));
                return(BeforeContinuationStatus.Abort); // Command aborted
            }

            return(base.OnBeforeExecution(context));
        }
 public ErrorContinuationStatus OnError(ExecutionCommandContext <AbstractDomainCommand> context, Exception exception)
 {
     throw new NotImplementedException();
 }
 public ContinuationStatus OnAfterExecution(ExecutionCommandContext <AbstractDomainCommand> context)
 {
     return(ContinuationStatus.Continue);
 }
 public BeforeContinuationStatus OnBeforeExecution(ExecutionCommandContext <AbstractDomainCommand> context)
 {
     _action();
     return(BeforeContinuationStatus.Continue);
 }
 public ContinuationStatus OnAfterExecution(ExecutionCommandContext <MyCommand> context)
 {
     return(ContinuationStatus.Continue);
 }