ADO.NET Data Services Beta bits don’t support complex types for service operations


If you're running into this limitation, you'll see the following error message every time you access the service.


The server encountered an error processing the request. The exception message is 'Method 'signature' has a return type 'return type' which is not supported for service operations. Only IQueryable and IEnumerable generics of primitive types or resource types are supported as return types.'.


What this message is trying to say in a somewhat confusing manner is that service operations in the beta bits only support returning "primitive types" (strings, numbers, GUIDs, DateTime, etc), and "resource types" (which would be better referred to as "entity types"). The only other kind of type is a "complex type"; that is - a type with sub-properties, but which doesn't have a key declaration and an available entity set, and as such we cannot produce URLs for.


The typical example for a complex type is an Address type which groups a bunch of primitives to represent street, state, zip code, country, etc.

Comments (2)

  1. rogerj says:

    Marcelo,

    Do you expect to fix this before RTM in SP1?

    –rj

  2. Yes, we plan on supporting queryables and enumerables of complex types, along with the ability to just specify a ‘naked’ return type and assume a single result (for example, declaring the service operation as returning a string instead of an IEnumerable<string> with a single result marker).

Skip to main content