tags:

views:

37

answers:

2

Hi,

I'm looking for a way to retrieve a collection of DTOs from my WCF data service in a way that will allow me to be informed every time a whole DTO from the collection has finished downloading, also I want to be able to read it of course.

Means, if I want to get a collection of users, every time a user from the collection is downloaded completely to the client (serializably-speaking), I want the client-side to be notified and be able to read it.

Is it at all possible?

Thanks!

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

+1  A: 

You’ll probably have to split it into multiple requests in order to do this. For example, one request to retrieve 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 this, you can even parallelise the whole thing.)

Timwi
A: 

You can't really subdivide a single call easily, so you'd best making one or two concurrent calls, and getting the objects individually. Using some kind of manager class, and some multithreading, you could have an event fired when a call was completed - and map that to an 'object downloaded' event.

Hope that helps.

Kieren Johnstone
Thanks Kieren, This is what I did eventually.
Captain