Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
133 views

Adding a dynamic GroupBy expression to an IQueryable

I want to pass a dynamic GroupBy expression into an IQueryable. I'm already doing something similar with a Where clause that is working OK. The purpose of the group by is then to allow my to extract ...
Mark Cooper's user avatar
  • 6,894
0 votes
0 answers
268 views

How to select first row in group using expressions

I have a task when the same table is used to work with different data which similar content. I use dynamic linq expressions to get data from sql. The most complicated task for me was to choose ...
Stanislav Gordenko's user avatar
2 votes
1 answer
106 views

How can I achieve to implement the below query without the if statement (SUM/AVG)?

public class DailyAggregator : Aggregator { public override Dictionary<string, int?> Aggregate<T>(IQueryable<T> query, Expression<Func<T, DateTime>> groupByProperty, ...
Istvan Zoltan Nyiko's user avatar
6 votes
3 answers
26k views

LINQ with GROUP BY and HAVING COUNT

I'd like to understand what I am doing wrong with my GROUP BY query in Linq. I've tried many examples (i.e. Linq with group by having count), but I still get more results (as is the WHERE is skipped). ...
Tjab's user avatar
  • 403