EntityFramework-Plus icon indicating copy to clipboard operation
EntityFramework-Plus copied to clipboard

Additional query hints

Open radekskl opened this issue 6 months ago • 2 comments

As per documentation, many table hints are supported. Is there a way to use query hints, like MIN_GRANT_PERCENT / MAX_GRANT_PERCENT, which should be included at the end of query?

radekskl avatar Jun 12 '25 11:06 radekskl

Hello @radekskl ,

In fact, all table hints are supported since we have an overload with a string that allow you to write your hint manually.

WithHint<T>(IQueryable<T> @this, string hint, params Type[] types)

We could try to add a WithQueryHint feature but you will have to write the hint manually as most of them such the both you are asking, require number.

Is that correct with you?

Best Regards,

Jon

JonathanMagnan avatar Jun 12 '25 13:06 JonathanMagnan

Hi @JonathanMagnan, defining full hint for such cases would work perfectly, thanks! It would also allow for disabling specific query optimizer features only for specific query.

radekskl avatar Jun 12 '25 13:06 radekskl