Click here to Skip to main content
15,443,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
var query=
                from _t in db.E_Cat
                join _s in db.E_StoryDetail on _t.CatID equals _s.SCat into testSubject
                      from _s in testSubject.DefaultIfEmpty()
                    group _t by new {_t.CatID,_t.CatName} into g
                select new { CatID = g.Key.CatID, CatName=g.Key.CatName, count = g.Count() };
Posted
v2
Comments
OriginalGriff 23-Apr-13 3:01am    
And your question is?

1 solution

var query = from _t in db.E_Cat
_s in db.E_StoryDetail
on _t .CatID equals _s.SCat into testSubject
from x in testSubject.DefaultIfEmpty()
select new {
CatID = _t.CatID, CatName=_t.CatName,count = testSubject.Count() };
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900