Advertisement
vasildiavolo

Untitled

Jan 6th, 2023
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. var test = _transactionQueryService.Value.GetAll()
  2. .Where(tx => tx.Status.Id != (long)TransactionStatus.Expired)
  3. .Where(tx => tx.Status.Id != (long)TransactionStatus.Cancelled)
  4. .Where(tx => tx.Status.Id != (long)TransactionStatus.Failed)
  5. .Where(tx => tx.TransactionProcessId == (long)TransactionProcess.Payin ||
  6. tx.TransactionProcessId == (long)TransactionProcess.Payout ||
  7. tx.EntryIndicator == (tx.TransactionTypeLink.TransactionType.TransactionTypeCategoryId == (long)TransactionTypeCategory.LoadAccount ||
  8. tx.TransactionTypeLink.TransactionType.TransactionTypeCategoryId == (long)TransactionTypeCategory.AdjustBalance
  9. ? Constants.EntryIndicator.Credit
  10. : Constants.EntryIndicator.Debit))
  11. .Select(tx => new
  12. {
  13. Transaction = tx,
  14. TransactionView = new
  15. {
  16. InitiatedByName = tx.InitiatedBy.Name,
  17. PresentationCurrencyCode = tx.PresentationCurrency.Code,
  18. StatusName = tx.Status.Name,
  19. tx.TransactionTypeLink.TransactionType.TransactionTypeCategoryId,
  20. TransactionTypeId = tx.TransactionTypeLink.TransactionTypeId.Value,
  21. TransactionTypeName = tx.TransactionTypeLink.TransactionType.Name
  22. }
  23. })
  24. .GroupJoin(allTransactionAcquiring, tx => tx.Transaction.Id, ta => ta.TransactionId, (tx, taGroup) => new
  25. {
  26. tx.Transaction,
  27. tx.TransactionView,
  28. LatestAcquiring = taGroup.OrderByDescending(ti => ti.CreationDate).FirstOrDefault()
  29. }).ToList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement