示例#1
0
 public Customer(SSN ssn, Name name)
 {
     Id        = Guid.NewGuid();
     SSN       = ssn;
     Name      = name;
     _accounts = new AccountCollection();
 }
示例#2
0
 public void LoadAccounts(ICollection <Guid> accountIds)
 {
     _accounts = new AccountCollection();
     foreach (var account in accountIds)
     {
         _accounts.Add(account);
     }
 }
        public void Register(IAccount account)
        {
            if (Accounts == null)
            {
                Accounts = new AccountCollection();
            }

            Accounts.Add(account.Id);
        }
示例#4
0
        public static Customer Load(Guid id, Name name, SSN ssn, AccountCollection accounts)
        {
            Customer customer = new Customer();

            customer.Id        = id;
            customer.Name      = name;
            customer.SSN       = ssn;
            customer._accounts = accounts;
            return(customer);
        }
 public Customer()
 {
     Accounts = new AccountCollection();
 }
示例#6
0
 public virtual void Register(Guid accountId)
 {
     Accounts = new AccountCollection();
     Accounts.Add(accountId);
 }
 protected Customer()
 {
     Accounts = new AccountCollection();
 }