LinqToQuerystring icon indicating copy to clipboard operation
LinqToQuerystring copied to clipboard

How to ignore or block some features?

Open ASADeveloper opened this issue 8 years ago • 0 comments

Hi,

Did anyone manage to block/ignore some operators to protect the API?

For example to be able to do some of the ideas in this blog https://blogs.msdn.microsoft.com/webdev/2013/02/06/protect-your-queryable-api-with-the-validation-feature-in-asp-net-web-api-odata/

But it doesn't need to be very extensive.

I want to only allow StartsWith function in $filter and ignore/block SubstringOf. One other case would be to only allow user to do OrderBy on some properties. (Otherwise probably all properties should have index in the database)

Any 'hacky' method is welcome, too!

By the way I've seen this very old issue #22 but it seems very old and forgotten. Maybe the new visitors see this issue better.

Thanks.

ASADeveloper avatar Sep 21 '17 10:09 ASADeveloper