Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to control client evaluation behavior on a per query basis #12844

Closed
divega opened this issue Jul 31, 2018 · 7 comments
Closed
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. type-enhancement

Comments

@divega
Copy link
Contributor

divega commented Jul 31, 2018

Based on the feedback we usually see this is very common and something like an AsServerOnly() query operator would be more usabel than the current way to turning client evaluation warnings into errors.

@optiks
Copy link

optiks commented Jul 31, 2018

An extension method on IQueryable for this would be great.

My main use case is where .ConfigureWarnings(warnings => warnings.Throw(RelationalEventId.QueryClientEvaluationWarning)) has been configured on the context, but where I still want to allow some client evaluation to occur (most likely because there is no server-side support).

i.e. I don't want an error thrown if there's nothing I can do to fix it.

@divega divega changed the title Provide a way to control client evaluation behavior on a query basis Provide a way to control client evaluation behavior on a per query basis Jul 31, 2018
@smitpatel
Copy link
Member

@optiks - Calling AsEnumerable method on IQueryable will allow you to do client evaluation even when warnings are configured to throw.

@ajcvickers
Copy link
Member

Added to Qu3ry issue.

@optiks
Copy link

optiks commented Aug 1, 2018

@smitpatel, AsEnumerable() isn't discoverable enough nor explicit enough IMO. I don't see how AsEnumerable() implies that client-evaluation is acceptable?

@smitpatel
Copy link
Member

AsEnumerable is similar to calling ToList. You are asking EF to materialize query results upto that point, whatever happens afterwards is outside of EF scope (aka client eval). If client eval in EF is throwing exception then it would also tell you what failed to translate which gives easy pointer where to put AsEnumerable in your query.

@optiks
Copy link

optiks commented Aug 31, 2018

Please also consider whether it would make sense to provide a predicate on Throws, i.e. something like warnings.Throw(RelationalEventId.QueryClientEvaluationWarning, query => /* some logic* / true). I'm not sure what the appropriate type for query would be.

I think this would let us then implement this behaviour ourselves if necessary, especially if the Expression was provided.

@ajcvickers
Copy link
Member

Closing as not needed now since the query changes for 3.0.

@ajcvickers ajcvickers removed this from the 3.0.0 milestone Jan 24, 2019
@smitpatel smitpatel removed their assignment Jan 12, 2022
@ajcvickers ajcvickers added the closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. label Mar 10, 2022
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. type-enhancement
Projects
None yet
Development

No branches or pull requests

4 participants