views:

1424

answers:

1

I was happily using RIA Services JULY 09 version and using a ServiceOperation for a method which takes some parameters and returns Entity.

[ServiceOperation] public Entity TestMethod(string param1, string param2, bool param3) { // do something here }

But as soon as i UPGRADED to WCF RIA services, I had to change [ServiceOperation] to [Invoke], but now I am getting a compilation error that Entity can not be returned for an Invoke Operation. I searched here and there and found out that for VS2008 it does not work but for VS 2010 it still works. I need to know if there's a workaround to do this for VS2008. I don't want this method to have deferred execution like query methods.

A: 

No, there isn't a workaround for 2008.

Eventually the VS2010/.NET 4 version of RIA Services will be RTM'd... so I'd suggest using that if you can deploy on top of .net 4.

If you have to stay on 3.5, then a query method is your only route. As a workaround, you can new up a DomainContext, issue a Load call, use the Entities result of the LoadOperation, and then simply discard the DomainContext... in other words you don't need to use the EntitySet/accumulation model if you don't want to for your particular scenario.

NikhilK
If this change was intentional for .net 3.5. It would be really nice if RIA services is released for 3.5 also. I have seen so many people using it and are going live with 3.5 only
Gaurave Sehgal