Aԃιƚყα Gυɾαʋ
Aԃιƚყα Gυɾαʋ

Reputation: 127

How to build an efficient query string in ASP.NET Core?

Hello World,

I'm in research mode for one of feature to be built in our software and there one new thing that we have never faced.

The thing is, on one form we have a drop down with list of items. User can select default which means all items needs to be considered or else he can selectively opt for certain list items.

Actually the form is related to filter functionality depending upon users input the data is going to get filtered and displayed on UI.

The main problem we are trying to solve is suppose user selects default, which means all list items ID's are gonna be considered in POST call of API. The list can be huge, say 1 to 1K and above too.

So under such circumstances we can build the query string but, it seems its gonna be so huge. I have also studied that certain browsers support limited query string as per their standard limits.

So currently I have following doubts in mind.

  1. Will shortening of query string work here ?
  2. By which technique it can be handled efficiently ?
  3. What performance considerations I need to take care during during so ?

Any suggestions or thoughts are welcome. That would boast my software design thinking.

Upvotes: 0

Views: 267

Answers (1)

Hussein Beygi
Hussein Beygi

Reputation: 471

based on what I understand from your question, here is my opinion:[if I understood wrong, please correct me, so I can help you]
You need to send query in URL and not in body or using JSON!is that correct?
I think you don't need to send every one of the selected items one by one! If there are selected in serial, you can perform a range in your query!
Like http://abcd/test?id=1-43,6-765(take ID as string and then export the useful data in back-end) with this approach, you can shorten your query!
And also think about the database too (if there is any).querying this much data is use a lot of IO and make query low performance.

Upvotes: 1

Related Questions