-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to filter/intercept query? #13
Comments
Can you provide some more details of what's you're trying to achieve? An example? Is this something that must be filtered on a server? |
I just found issue #9 where a sample in VB.Net was posted,so I'am currently using this piece of code which seems to work: [QueryInterceptor("LogMessages")]
public Expression<Func<DSPResource, bool>> OnPostQuery()
{
Guid? myApiKey = new Guid("00000000-0000-0000-0000-000000000000");
return x => (Guid)x.GetValue("ApiKey") == myApiKey;
} Is this the right way to it? #Edit: [QueryInterceptor("LogMessages")]
public Expression<Func<LogMessage, bool>> OnPostQuery()
{
Guid myApiKey = new Guid("00000000-0000-0000-0000-000000000000");
return x => x.ApiKey == myApiKey;
} Currently it just throws an exception that the types doesn't match:
|
Thanks for an example. I will try to reproduce the exception. |
Hello, I want to intercept a query in a way that only data are returned that contains a given GUID so the user can only see his own data. How can I do this?
The text was updated successfully, but these errors were encountered: