Exemple #1
0
        private Account GetAccountFromRepository(string accountNumber)
        {
            Account account = EntityConverter.FromDalAccount(repository.GetAccount(accountNumber));

            if (account == null)
            {
                throw new ArgumentNullException(nameof(account));
            }
            return(account);
        }
Exemple #2
0
        public DetailedAccount GetAccountInfo(string accountNumber)
        {
            DalAccountDetailed dalAccountDetailed = repository.GetAccountHistory(accountNumber);

            return(new DetailedAccount
            {
                AccountObject = EntityConverter.FromDalAccount(dalAccountDetailed.AccountObject),
                Operations = dalAccountDetailed.Operations.Select(op => new AccountOperation
                {
                    Id = op.Id,
                    AccountId = dalAccountDetailed.AccountObject.Id,
                    Operation = op.Operation,
                    OperationDate = op.OperationDate,
                    OperationValue = op.OperationValue
                })
            });
        }