79433692

Date: 2025-02-12 16:00:21
Score: 0.5
Natty:
Report link

You can achieve this by using .Any() in your LINQ query to check if there are any trades associated with a given MainAccount.

Perhaps something like this:

select new MainAccountDto
{
    AccountId = ma.AccountId,
    HasTrades = context.Trades.Any(t => t.AccountId == ma.AccountId)
};
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Dave Morrison