Skip to main content
8 votes
Accepted

Expression Conversion

You could use the ExpressionVisitor class to give yourself some more flexibility and not have to handle all the conditions yourself. ...
CharlesNRice's user avatar
  • 4,438
3 votes

Chain LINQ expressions for filtering

You have such properties as ExerciseFilter and DateFilter that I guess return respecitively the ...
t3chb0t's user avatar
  • 44.7k
3 votes

Expression Conversion

Can I say first off - this is excellent - both the post and the provided answer. I tool follow a similar pattern of surfacing a DTO through my controllers and abstracting away my data access. I ...
JDBennett's user avatar
  • 131
2 votes
Accepted

A simple method to execute Entity Framework Core queries in parallel

All public API surfaces should validate input parameters. Restricting the queries to a single entity type seems limiting. You can't join entities with no navigation properties. It fails when using ...
Johnbot's user avatar
  • 3,084
1 vote

Merging every two objects into single single object making group by a property C# LINQ

If you want to reduce the iteration to get the value for ColumnC and ColumnD and make the code cleaner, you can try using Aggregate instead. ...
Moch Yusup's user avatar
1 vote

Chain LINQ expressions for filtering

One of the things that I find jarring is that your model contains properties such as ExerciseFilter (the filter value), but the ...
Flater's user avatar
  • 5,720
1 vote

Chain LINQ expressions for filtering

You could abstract a ConditionalFilter to be used in a list with LINQ instead of writing many if statements: ...
JanDotNet's user avatar
  • 8,608
1 vote

Chain LINQ expressions for filtering

Seems you could simplify it to just be this. Takes 3 if to 2 and I feel reads better. ...
CharlesNRice's user avatar
  • 4,438

Only top scored, non community-wiki answers of a minimum length are eligible