At the moment (RC bits) WCF RIA doesn’t support custom DTO as parameters for domain service operations. If you define
You won't be able to do this
Compiler will greet you with this encouraging message:
Operation named 'MyOperation' does not conform to the required signature. Parameter types must be an entity type or one of the predefined serializable types.
Well, don’t be scared, there is workaround (as usual) to make our custom DTO “RIA friendly” (or Entity type in RIA terms).
You need to do 2 simple but not obvious things
1. Make your class identifiable by providing RIA with identity property(ies)
Note that we don’t need WCF data contract attributes anymore – RIA code generator takes care of it
2. Expose our “entity” via domain service dummy Query
Now you can successfully compile your project and use your custom operation with custom DTO client side
but what about more complex DTOs with sub lists (data graphs)? well, just wait for the next post ;)