In part 4 of this series I showed how to declare a POCO for use in RIA services, and how to use the object on the client. In this post, I'll show how to use a class in another project/assembly. Honestly, it's not very difficult at all.
As part of the SocialBus solution, I already has a User class defined in another project (SocialBus.Model). This is a pretty straightforward class as-is:

A user in SocialBus is just a SocialBus specific user id, and a ServiceInfo object. The ServiceInfo object is what is of real interest in SocialBus, as it will contains users and messages from various social networks (Twitter, Yammer, ...) that are mapped to this SocialBus user with the specified ID. But for purposes of this example, it is only needed to be concerned with this User class.
To RIA enable this class, all I need to do as before is annotate the class, and all that is needed for now is to add a Key attribute:

This class is now ready to be used in the RIA services library. All that is needed to be done is to add a reference to SocialBus.Model to SocialBus.RIA.Web, and to change the domain service to return an instance of this User class:

Now this service is very contrived and not of much use, but this is just for showing this example. In another series of posts I will discuss connecting the domain service to LINQ to SQL, Twitter and Yammer; returning collections of objects; but like I said that's for another time.
The differences in this service model are really just in the using for the SocialBus.Model namespace, and in returning and instance of that object. The client only changes slightly (besides there are no e-mail and username properties) is that I needed to add a 'using SocialBus.Model;' line.
That's it for this series. There's a lot more that can be covered, but like I said those will be for another series of posts (that I'll do soon).
c16efd58-696b-4c08-9139-f71dd9f0acb5|1|5.0