Beispiel #1
0
        public static AccountSnapshot Make(IEnumerable <Transaction> transactions, Account account)
        {
            var snapshot = new AccountSnapshot(account.Id);

            AnonymousAccountSnapshot.Make(snapshot, transactions);

            return(snapshot);
        }
Beispiel #2
0
        //----------------------------------------------------------------------------------------------

        private static AccountSnapshot GetAccountSnapshot(Session session, Oid accountOid)
        {
            AssertIsValidSession(session);

            var repository = session.Repository;

            AccountSnapshot snapshot = null;

            using (repository.Read())
            {
                var account = repository.GetAccountByOid(accountOid);

                if (account != null)
                {
                    var transactions = repository.GetTransactionSnapshot(accountOid);

                    snapshot = AccountSnapshot.Make(transactions, account);
                }
            }

            return(snapshot);
        }