views:

183

answers:

1

Is there any way at all to create a "mock" entity type for use in a WCF Service Operation?

We have some queries we do that we need to optimize by exposing as a ServiceOperation. The problem is in order to do so we would result in a very long list of primitative types...

Ex

  SomeoneHelpMe(int time, string name, string address, string i, string purple, string foo, int stillGoing, int tooMany, etc...)

And we really need to reduce this to

 SomeoneHelpedMe(CustomEntityNotMappedToAnything e)

This would also help us when it comes time to write some complex queries since there is a 3 param limitation...

I saw this will be possible in 4.0 using "complex types", but i am still in the 3.5SP1 world.

Let me know if anyone needs more information.

So this is confirmed not possible in 3.5 or 4.0! Officially its a no!

http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/771587aa-0822-4991-8a3f-0091de044b5c

A: 

There is no way to do this currently - both in 3.5SP1 and 4.0. Only primitive types are supported as parameters for service operations.

Use the following link to add this as a feature request: https://connect.microsoft.com/data/SearchResults.aspx?SearchQuery=WCF%2bData%2bServices. You need to sign in and then you can see the list of bugs/features that have been reported externally. You can add in a new feature request or vote for an existing feature request.

Thanks Pratik

Pratik Patel
joy, i thought this was possible by modeling complex types in 4.0 ?
Nix
confirmation from microsoft http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/771587aa-0822-4991-8a3f-0091de044b5c
Nix
following up though because i have read it is possible http://samuelmueller.com/2009/11/working-with-projections-and-dtos-in-wcf-data-services/
Nix