Exemplo n.º 1
0
        protected override ActivityExecutionStatus Execute(
            ActivityExecutionContext executionContext)
        {
            IAccountServices accountServices =
                executionContext.GetService <IAccountServices>();

            if (accountServices == null)
            {
                //we have a big problem
                throw new InvalidOperationException(
                          "Unable to retrieve IAccountServices from runtime");
            }

            //apply the adjustment to the account
            Account = accountServices.AdjustBalance(Id, Adjustment);

            return(base.Execute(executionContext));
        }
Exemplo n.º 2
0
 private void codeAdjustAccount_ExecuteCode(object sender, EventArgs e)
 {
     //apply the adjustment to the account
     Account = _accountServices.AdjustBalance(Id, Adjustment);
 }