I have list of a custom class which is a Model in the mvvm pattern . I need to insert the list data in the DB . So can anyone suggest what is the best way to pass this list to the web service ?
Thanks
Answer: 1
If list is not too large you could try it serializing the list and sending it "as is". If it is too large you may have problems with the MaxReceivedMessageSize and maxBufferSize properties of your service, you should set them as big as you can. Of course, I assume you have the same Model both sides (client and server) to serialize and deserialize it.
To reduce the data size you send you could try to use TCP binding instead HTTP.
If it's still too large, you may have to chunk the list and send it by calling several times the same service.
I've done several workarounds in many cases too. If for example you only need to update a list of objects changing just a couple of fields, I use to make a new list of object-id + new values and make changes server side instead of changing everything in the client and then sending it to the server.
Hope this helps you ;-)
by : zapicohttp://stackoverflow.com/users/694693Answer: 2
We expose a WCF service that sends and receives DTO's, then create a service reference in Silverlight. We use EmitMapper in Silverlight to map model classes to the proxy-generated DTO's.
by : borishttp://stackoverflow.com/users/874831
No comments:
Post a Comment
Send us your comment related to the topic mentioned on the blog