RIA Services: Sending complex types to the client

Entity Framework 4 allows us to create complex types. Typically, such types are used to get the result of a stored procedure. However, when we try to send such a complex type using a WCF RIA Domain Service, the following error is encountered.

The entity ' StoredProcedure_Result' in DomainService 'MyDomainService' does not have a key defined. Entities exposed by DomainService operations must have at least one public property marked with the KeyAttribute.

What to do? Read the rest of this entry »