Skip to content

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

Closed as not planned

Description

@divega

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.

Activity

  1. optiks commented on Jul 31, 2018

    @optiks

    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.

  2. 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[/+] on Jul 31, 2018
  3. smitpatel commented on Jul 31, 2018

    @smitpatel
    Contributor

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

  4. added this to the 3.0.0 milestone on Aug 1, 2018
  5. ajcvickers commented on Aug 1, 2018

    @ajcvickers
    Contributor

    Added to Qu3ry issue.

  6. optiks commented on Aug 1, 2018

    @optiks

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

  7. smitpatel commented on Aug 2, 2018

    @smitpatel
    Contributor

    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.

  8. optiks commented on Aug 31, 2018

    @optiks

    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.

  9. ajcvickers commented on Jan 24, 2019

    @ajcvickers
    Contributor

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

  10. removed this from the 3.0.0 milestone on Jan 24, 2019
  11. removed their assignment
    on Jan 12, 2022
  12. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions