We are building a query service for client which have the following requirements:
- Support Where, Begin, Contains, And, Or, Paging, Select. (1-main)
- Lookup/Mapping multiple values from one value to another values. Client will pass hundreds of values and it will return the same amount of values back. (2)
- Return some clear error codes for invalid requests (Missing parameters, Unknown field specified, Unknown Where condition specified, etc) (3)
For (1) and (2), we have seen that OData has strong syntax for supporting them and (OData + WebAPI) may be a good/flexible solution but we have some concerns:
- Client wants to pass query over POST, not GET, due to the large filter size from (2). We saw some options, so we think about these 2 solutions for OData: ($batch-supported OData endpoint, POST OData URI and manually parse it into ODataQueryOption)
- There are some concerns about OData endpoint query performance. Is it good enough or can we just use POST OData URI and use custom store procedure for best performance?
- For (3), it seems we haven't found a way to invoke OData enpoints to return correct error codes yet.
We also think about building a custom JSON object, pretty much same as ODataQueryOption and use Web.API actions for each of those requirements in case OData cannot completely handle those requirements with good performance. But it would be our last choice.
So what's your choice to implement those 3 above? Thanks.