1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:  using System.Text;
   5:   
   6:  namespace Marvin.Examples
   7:  {
   8:     public class Account{
   9:          public Account(ICollection<LedgerEntry> ledgers){
  10:              Ledgers = ledgers;
  11:          }
  12:          role
  13:              void AddEntry(string message,decimal amount){
  14:                  Ledgers.Add(new LedgerEntry(message, amount));
  15:              }
  16:              decimal GetBalance(){
  17:                  return ((ICollection<LedgerEntry>)Ledgers).Sum(e => e.Amount);
  18:              }
  19:          }
  20:   
  21:        C:\Projects\fullOO\www\Examples\Marvin\Introduction\index.htmlpublic decimal Balance{
  22:          get  {
  23:                return Ledgers.GetBalance();
  24:            }
  25:        }
  26:   
  27:        public void IncreaseBalance(decimal amount)
  28:        {
  29:            Ledgers.AddEntry("depositing",amount);
  30:        }
  31:   
  32:        public void DecreaseBalance(decimal amount)
  33:        {
  34:            Ledgers.AddEntry("withdrawing",0-amount);
  35:        }
  36:      }
  37:  }