Not sure what the issue is with your custom AutoQuery impl, you’ve not provided any details about the error, what your table looks like or what the resulting SQL is. I’d enable debug logging or built-in profiling so you can see the SQL that’s generated which will hopefully identify what the issue is.
Also when your query gets too complicated, just ignore AutoQuery and implement the query as you would without it. i.e. don’t use AutoQuery if it doesn’t support your use-case.
but how store list of data?? loop list and add each item to cache?
No I wouldn’t do multiple cache hits to store a list of items, each call is a blocking I/O operation if you’re using anything other than the MemoryCacheClient. I’d store the entire collection under a unique key that populated the results, e.g. a lot of the time you could use the relative url as the string that generates those results.
You need to call the Service asking for a JSON response. If you’re calling this Service from an MVC Controller the request is most likely asking for a HTML response.