Set operations: support when placed after client evaluation in projection
See original GitHub issueTest case:
public virtual Task Client_eval_Union_FirstOrDefault(bool isAsync)
=> AssertFirstOrDefault<Customer>(
isAsync, cs => cs
.Select(c => ClientSideMethod(c))
.Union(cs));
Can probably be punted post-3.0 (can be easily worked around).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:30 (12 by maintainers)
Top Results From Across the Web
Can't process set operations after client evaluation efcore
This is a limitation of EF Core and I don't think it will be resolved ever. First list is easily translatable to the...
Read more >Can't process set operations after client evaluation
Unable to translate set operation after client projection has been applied. Consider moving the set operation before the last 'Select' call.
Read more >Can't process set operations after client evaluation efcore ...
This is a limitation of EF Core and I don't think it will be resolved ever. First list is easily translatable to the...
Read more >Client vs. Server Evaluation - EF Core
EF Core supports partial client evaluation in the top-level projection (essentially, the last call to Select() ).
Read more >Tracking vs. No-Tracking Queries - EF Core
An individual query can be set to be no-tracking. ... If EF Core materializes an entity instance for client evaluation, it will be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Your example is not complete because you request on same table I have the use case with two tables with one different column but i want to make a union in a common object. I Can’t I have the same error
I would like to
@Maleaume @brandonsmith86 @BeejeeDS the only issue here is with set operations after a client projection - as long as you write your query to place the union before that, there’s no issue. You can typically do this by projecting to an anonymous type (which works fine and doesn’t require client translation) and doing everything you need on that. If you need to project out to your own type, do that at the end.
For example: