Posts Tagged ‘LINQ’

Group By with LINQ

Today i wanted to do a group by query with LINQ wich is something i never done before. I turned out to be kind of easy.
If you just want to group by a single field.
(from s in db.CrewStatsSet
where s.LogDate >= date1 && s.LogDate <= date2 && s.Action == action
group s by s.User.nick into g
orderby g.Count() [...]

Create a tag cloud with limited amout of tags in ASP.NET and LINQ

Today i built a Tag cloud for my new site. I found this great article about on how to do it with LINQ and C#. But i missed some features. Especially how to limit the number of tags that was shown. So if you read that article and then have a look at this code [...]