joukevandermaas / saule

JSON API library for ASP.Net Web API 2.
https://joukevandermaas.github.io/saule
MIT License
76 stars 37 forks source link

Customized query-able endpoints #120

Closed bxh closed 6 years ago

bxh commented 8 years ago

I'm wondering what the most efficient approach is to support filtering for a server backend that does not leverage EF.

Would you consider in future version Saule simply parses query parameters and leave all the filtering work to controller methods?

joukevandermaas commented 8 years ago

Yeah, that seems fair. I assume by not using EF you mean you don't return IQueryable but you still want the client to influence your DB query? Saule internally already has QueryContext which should contain most of the info you need to do querying.

To implement this in a good way, that class and the more specific contexts would need to get a more unified API and be made immutable. Then they'd need to be passed into the action method somehow. There'd also need to be a mechanism to disable Saule's own filtering (this could likely just depend on the action method's parameters, or an attribute).

joukevandermaas commented 6 years ago

This was mostly implemented in #181 by @sergey-litvinov-work. The only remaining task before this issue can be closed is to document that work.