WCF Data Object Gets Progress

I am looking for a way to get a DTO collection from my WCF data service so that I can be informed every time the whole DTO from the collection has finished loading, I also want to be able to read it, of course.

So, if I want to get a collection of users, every time a user from the collection is fully loaded to the client (serializable), I want the client side to be notified and able to read it.

Is it possible?

Thank!

Edit: Does the callback from the client to the server, which the server will use to send each user to the client through iteration, possible / correct direction? Or is there a better solution?

+3
source share
2 answers

You cannot easily split a single call, so your best bet is to make one or two simultaneous calls and get the objects separately. Using some kind of manager class and some multithreading, you could fire an event when the call was completed and match this with the event loaded by the object.

Hope this helps.

0
source

You may have to split it into multiple queries to do this. For example, one request to get the size of the collection, and then a separate request for each item in the collection. Then you know when each item completes. (If you do, you can even parallelize all of this.)

+1
source

Source: https://habr.com/ru/post/1757546/


All Articles