コード例 #1
0
ファイル: Account.cs プロジェクト: x3nx1a/dotnet-new-caju
        public Account()
        {
            Register <DepositedDomainEvent>(When);
            Register <WithdrewDomainEvent>(When);
            Register <OpenedDomainEvent>(When);
            Register <ClosedDomainEvent>(When);

            Transactions = new TransactionCollection();
        }
コード例 #2
0
ファイル: Account.cs プロジェクト: x3nx1a/dotnet-new-caju
        protected void When(OpenedDomainEvent domainEvent)
        {
            //
            // Open an Account
            //

            Id           = domainEvent.AggregateRootId;
            CustomerId   = domainEvent.CustomerId;
            Transactions = new TransactionCollection();

            Transaction credit = new Credit(
                domainEvent.AggregateRootId,
                domainEvent.TransactionId,
                domainEvent.TransactionAmount,
                domainEvent.TransactionDate);

            Transactions.Add(credit);
        }
コード例 #3
0
ファイル: Account.cs プロジェクト: x3nx1a/dotnet-new-caju
 protected Account()
 {
     Transactions = new TransactionCollection();
 }