I have the following sample columns
ID Comment Analyzer Incubator Deanalyzer
-- ------- ------- --------- ----------
23 Need Fast 5.6 8.7
What I need is to show the results is the ID, Comments, then a count of
how many columns had values. So in this case count would be 2 as only Analyzer and Deanalyzer have values. This is what I have so far:
var result = from tb in db.Reports
where tb.Id == 23
select new { ID = tb.ID,
Comments = tb.Comments,
Count = ..
}
It’s not clean but you could do:
I wouldn’t use this if you have lots of columns.