Reputation: 27
I'm working on a MVC 5 web application, On this app i'm using web service to search in hotels. My customers complete fields of query and submit. Response of per query is a massive model,as example 1000 model, that each contains other massive models. What is best way to display this result? On similar conditions that have Information in db, I use paging like this:
public IList<Result> Search(SearchModel searchModel, int pageNumber, int recordsPerPage = 15)
Can i keeping result of per customer in memory and do paging on result?
Any better idea?
Upvotes: 0
Views: 125
Reputation: 14820
What is best way to display this result?
Eagerly, if possible, and you already have an idea of how to implement paging on a result set. It all depends on whether this web service you're consuming supports paging. Hopefully it does. The main thing you need to avoid here is loading big data in memory and then send it to a client's device/browser because it's not needed, the human eye will not be able to see 100+ records at the same time; that, plus the obvious, it's a waste of resources such as memory and CPU usage...no matter how powerful your server(s) are.
I'd suggest you to find out if this web service supports paging. If it doesn't (would be weird not to) maybe some sort of background worker such as a Windows Service that runs the query and stores them in a database would do, then your web app can easily page through the results in the database to produce a paged result set.
Upvotes: 2