Ejemplo n.º 1
0
        public async Task <TransactionDownloadResult <T> > DownloadTransactions()
        {
            var result = await Download();

            ProcessTransactions(result);
            LastDownloadResult = result;
            return(result);
        }
Ejemplo n.º 2
0
        void ProcessTransactions(TransactionDownloadResult <T> result)
        {
            if (result.Code == TransactionDownloadResultCode.Ok && result.Count > 0)
            {
                if (!QueryOlder && RemoveOnGap)
                {
                    var last = result.Transactions.LastOrDefault();
                    // check for gap and clear the list
                    if (!Transactions.ContainsKey(result.NextPreviousId))
                    {
                        Transactions.Clear();
                    }
                }

                foreach (var transaction in result.Transactions)
                {
                    if (!Transactions.ContainsKey(transaction.Transaction.OperationId))
                    {
                        Transactions.Add(transaction.Transaction.OperationId, transaction);
                    }
                }
            }
        }