Adding a query hint when calling Table-Valued Function

I came across this: https://entityframework.codeplex.com/wikipage?title=Interception And it appears that you can do something like this: public class HintInterceptor : DbCommandInterceptor { public override void ReaderExecuting(System.Data.Common.DbCommand command, DbCommandInterceptionContext<System.Data.Common.DbDataReader> interceptionContext) { command.CommandText += ” option (recompile)”; base.ReaderExecuting(command, interceptionContext); } } And register it like this (I did it in Application_Start of global.asax.cs): DbInterception.Add(new HintInterceptor()); And it will … Read more