var scoreData from cg in categoryGroup CategoryIds join feedCategory i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
var scoreData = (from cg in categoryGroup.CategoryIds
join feedCategory in categories on cg equals feedCategory.Id
join amc in authorCategories on cg equals amc.CategoryId into categoryData
from cat in categoryData.DefaultIfEmpty()
select
new GroupScoreDataItem
{
CategoryId = cg,
WeightFactor = feedCategory.WeightFactor,
CategoryCount = (cat != null ? cat.Count : 0)
}).ToList();
return scoreData;