Using Webservices with Telerik OpenAccess

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

Ready to Start?

Let's Build Something Amazing Together

Ready to bring your vision to life? We specialize in creating stunning websites, mobile apps, and digital experiences that make an impact.

Accepting new clients
Free consultation
15+ years experience