On the UserVoice page , to request this feature to be officially added to the Breeze , Ward Bell offers a decent job:
Meanwhile, in your controller, you can check the query string from the query for $ select and $ expand and throw an exception if you see it.
I assume it will look something like this:
[HttpGet] public IQueryable<Widget> Widgets() { if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["$expand"])) { throw new Exception("Ah ah ah, you didn't say the magic word!"); } return _contextProvider.Context.Widgets; }
... to block all extensions or something more specific, to block the extension of functions. It is not too shabby, but not quite "elegant."
(Yes, this is a link to Jurassic Park .)
Grinn source share