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.
...
3
votes
Chain LINQ expressions for filtering
You have such properties as ExerciseFilter and DateFilter that I guess return respecitively the ...
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 ...
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 ...
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.
...
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 ...
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:
...
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.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
c# × 13linq-expressions × 13
linq × 8
expression-trees × 3
performance × 2
object-oriented × 1
.net × 1
validation × 1
entity-framework × 1
wpf × 1
iteration × 1
reflection × 1
properties × 1
entity-framework-core × 1