Exemplo n.º 1
0
        public Account GetAccountById(int id)
        {
            var account = myDataAccess.GetAccountById(id);

            account.MakePayment(account.Balance * 0.01M, DateTime.Now);

            return(account);
        }
Exemplo n.º 2
0
        public Account GetAccountById(int id)
        {
            // you a chance to examine and alter the input before the decorated instance is invoked.
            Console.Out.WriteLine("About to get account with id {0}", id);

            var account = myDataAccess.GetAccountById(id);

            // you also get a chance to examine the output after the decorated instance is invoked.
            Console.Out.WriteLine("Got account with Id {0}, balance, {1:0.00}", id, account.Balance);

            return(account);
        }