I am using Entity Framework, ASP.NET Web API and there is a WinForm client that sends its data to the server or receives.
I know how to get one record and also how to get a collection of records at one time, but there maybe a lot amount of records which may cause problems. So how can I get a collection of new information one by one in the client side?
I think I can get a list of new ID’s first and then getting them one by one. Is there a better approach?
any information about implementing this will be useful.
EDIT: to be clear, I mean getting a collection of information from server in client machine and not in server from database 🙂
A very common approach to this problem is to create some form of paging. For instance, the first time, just get the first 50 records from the server. Then based on some condition (could be user triggered, or automatic based on time, depends on your application) get the next set of data, record 51 – 100.
You can get creative with how you trigger getting the various pages of data. For instance, you could trigger the retrieval of data based on the user scrolling the mouse wheel if you need to show the data that way. Ultimately this depends on your scenario, but I believe paging is the answer.
Your page size could be 5 records, or it could be 500 records, but the idea is the same.