This article is about creating WCF RIA service in class library assembly instead of in the Silverlight application. For unknown reason (at least for me) most, if not all of the Silverlight samples implement the service logic in the main Silverlight application project. But since MVVM is all about de-coupling and re-using, Those services should be implemented in class library and exposed by the application. Press here to download demo solution. In this solution you will find a working service as shown above.
Creating the service in class library project1 Open your application solution.
2 Add project of type 'Class Library' (Notice not to select 'Silverlight class library').
3 In the newly created project add an item of type 'WCF service'. This file extension is '.cs' and not '.svc'. Don't worry about it at the moment.
Read more: Eran Sakal's blog