var transactionList =
from transaction in _context.Transactions
from destinationUser in _context.Users
from destinationUserWallet in destinationUser.Wallets where destinationUserWallet.Id == transaction.DestinationWalletId
from sourceUser in _context.Users
from sourceUserWallet in sourceUser.Wallets where sourceUserWallet.Id == transaction.SourceWalletId
where destinationUser.Id == User || sourceUser.Id == User
select new
{
sourceUserName = sourceUser.Name,
destinationUserName = destinationUser.Name,
transaction
};
public int[,] GetIntValue(ValueClass[,] values)
{
return values.Cast<ValueClass>()
.Select((x, i) => new { x?.Value, i })
.Aggregate(
new int[values.GetLength(0), values.GetLength(1)],
(accum, item) =>
{
accum[item.i / values.GetLength(1), item.i % values.GetLength(1)] = item.Value.GetValueOrDefault();
return accum;
});
}