- Published on
Using Webservices with Telerik OpenAccess
- Authors
- Name
- Steve McNiven
- @stevemcniven
One of the major issues with querying a webservice with the non-domain model approach to OpenAccess was that if you tried to return a list of objects directly you can’t dispose of your scope! Ack!
What happens client side is that you get a callback error saying “The ObjectScope is already closed”…bummer I wanted those objects
I had a bunch of tickets go back and forth with the OpenAccess guys at Telerik and they suggested using fetch plans. I however do not want to setup 40 fetch plans :)
So lets use anon typed in-memory objects…they seem to return fine while allowing me to kill my scope.
So from this:
To this:
So really we’re just re-creating the objects, but you can now dispose of your scope before you return from the webservice with no errors!
Cheers,
Steve