I have the following SQL:
SELECT
*,
(SELECT COUNT(*) FROM WebOrder_URLHistory WHERE WebOrder_URLHistory.LeadID = Leads.LeadID) AS Sales
FROM
Leads
I want to put it (the select count statement) in this LINQ statement so I can get the sales count in my linq statement:
Dim TheLeads = (From L In DB.Leads Where L.IsDeleted = False Select L).ToList()
Is this possible to do in LINQ?
You can write
Select L, L.UrlHistory.Count()