Search Wiki:

WCF RIA Services


Microsoft WCF RIA Services simplifies the traditional n-tier application pattern by bringing together the ASP.NET and Silverlight platforms using WCF. The RIA Services provides a prescriptive pattern to write application logic that runs on the mid-tier and controls access to data for queries, changes and custom operations. It also provides end-to-end support for common tasks such as data validation, authentication and roles by integrating with Silverlight components on the client and ASP.NET on the mid-tier. It includes rich tooling for integrating client and mid-tier projects and for building rich UI through the simplicity of drag-drop support.

For more information on RIA Services (Download Link, MSDN Docs, Talks ...) click here.
For help porting your existing applications to the latest bits click here - Breaking Changes from July CTP to PDC 2009

Please use the forums to provide feedback or post questions.

Getting Started - RIA Services HRApp Walkthrough


The walkthrough provides a step by step guide to building your first RIA services application.
The application we will be building here is an HR Application for an Enterprise.

Click here to download: Getting Started - RIA Services HRApp Walkthrough
To download a flavor of the walkthrough that highlights the VS2010 Tooling features click here.

Feature Samples


WCF extensibility sample

This sample demonstrates how RIA Service's developers can leverage the power and flexibility of the WCF platform. It demonstares how WCF behaviors can be added to a Domain Service, how an explicit .SVC file can be generated for the default Domain Service WCF endpoint and how a custom ServiceHost can be defined for a Domain Service.

Click here to download: WCF extensibility sample

'Add Service Reference' to a Domain Service

This sample demonstrates a WPF (Windows Presentaion Foundation) Application communicating with the WCF service exposed by a DomainService. The application does an AddServiceReference to the WCF DomainService to get a ServiceReferenceClient. It then queries the service for data, as well as makes updates to the data model.
The sample also shows has a Silverlight head working against the same Domain Service.

Click here to download: 'Add Service Reference' to a Domain Service

Authentication Quick Starts

These quick starts cover the key use cases for the Authentication Service. While some show basic integration with ASP.NET, others tackle more complex scenarios including Custom Authentication, Out of Browser & Offline Autnentication, and Windows Live ID support. 'Quick Start' comments have been included in the source to highlight and explain the implementation.

Click here to download: Authentication Quick Starts

Custom Metadata Provider

This sample serves two purposes. First, it demonstrates how to create a custom metadata provider that can participate in the RIA Services metadata pipeline. Secondly, the sample also provides a solution to the existing problem of providing additional metadata for types that you don’t own or can’t modify.

Click here to download: Custom Metadata Provider

Testing Domain Services [demos Repository pattern]

This sample demonstrates how DAL layer can be mocked to Unit Test business logic code implemented in DomainService class. In this sample this is done my implementing a repository pattern, specifically a repository pattern with Linq To SQL as DAL. Instructions on using the sample can be found in the ReadMe doc included with the sample.

Click here to download: Testing Domain Services [demos Repository pattern]

Custom Domain Service DAL Provider

This sample demonstrates how to create a RIA Services DomainService Base Class for a particular Data Source or Data Access Layer (DAL). Two such providers ship with the framework already – the LinqToSql and LinqToEntities DomainService base classes. All the APIs and functionality needed to create these providers is public, which supports the creation of providers targeting other sources of data, for example NHibernate, Amazon Web Services ...

Click here to download: Custom Domain Service DAL Provider

Hosting RIA Services Apps in Azure

This sample demonstrates hosting WCF RIA Services application in Windows Azure.

Click here to download: Hosting RIA Services Apps in Azure

AuthenticationService in RIAServicesClassLibrary

This sample demonstrates manually generating and configuring a WebContext, when the Authentication Service resides in a RIA Services Class Library.

Click here to download: AuthenticationService in RIAServicesClassLibrary

Application Samples


Contoso Sales Application

Contoso Sales is the RIA Services application demoed at PDC 2009 in Scott Guthrie's Keynote.

Click here to download: Contoso Sales Application

Sample Classifieds Application

CyclingClassifieds sample is an ad-sharing intranet Web-application that lets users browse existing ads and post new ads. This sample demonstrates end to end usage of RIA Services and Silverlight features.

Click here to download: Sample Classifieds Application

Silverlight Store [demos POCO and SEO support]

This simple application demonstrates the use of XML data, a Plain Old CLR Object (POCO) DomainService and Search Engine Optimization (SEO). The ASP.NET DomainDataSource control is used to render content as well as a XML sitemap, all indexable by search engines. The down-level content is only visible to clients viewing the site without the required version of Silverlight installed (or JavaScript disabled).

Since ASP.NET DomainDataSource only supports .NET 4, this sample will only work on the VS 2010 release of RIA Services.
Click here to download: Silverlight Store [demos POCO and SEO support]


Tools

Visual Studio 2010 Update Tool

The tool updates RIA Services VS 2008 projects to VS 2010.
For users upgrading their July CTP VS 2008 project to Dev 2010, it is recommend they first upgrade to the PDC bits on VS 2008 (i.e. consume all the breaking changes) and then move to Dev 2010.

Click here to download: Visual Studio 2010 Update Tool
Last edited Dec 22 2009 at 12:29 AM  by SaurabhPant, version 74
Comments
adityavoleti wrote  Nov 21 2009 at 5:47 PM  
Please fix the download link for Authentication Samples for VS/VWD 2008. Thanks for the material.

SaurabhPant wrote  Nov 22 2009 at 8:30 AM  
@aditya - The link has been fixed

adityavoleti wrote  Nov 22 2009 at 11:19 PM  
Thank you.

eslsys wrote  Dec 15 2009 at 6:34 PM  
Hosting RIA Services App in Azure is missing a referenced project, MyApp.CloudService

joslat wrote  Dec 22 2009 at 11:37 AM  
Great samples! The only issue I see is that the "AuthenticationService in RIAServicesClassLibrary" sample is in VS 2010, do you have it in vs 2008 format?
Thanks so much!! - Jose

ScottNZ wrote  Jan 4 at 1:54 AM  
I second the request for WebContextInClassLib in VS2008. Also, I'm just not seeing the LiveID authentication code in the AuthSamples_VS2008; am I overlooking something obvious? The samples are much appreciated--thanks!

AlexanderBykin wrote  Jan 7 at 10:04 PM  
Testing Domain Services [demos Repository pattern]
HRAppCS_DAL_Mocking_VS2010 source code, 637K, uploaded Nov 18 2009 - Is not an VS2010 project!

work2gs wrote  Jan 15 at 8:56 AM  
Hi
I have installed AdventureWorks2008_SR4.exe (http://msftdbprodsamples.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=37109)
on my pc
And I can see the all the new databases in sqlserverExpress2008 as AdventureWorks, AdventureWorksDW, AdventureWorksDW2008....
But I need AdventureWorks_Data.mdf where is it ???????????????????
I would like to run a this sample HRAppCS_VS2010 (http://code.msdn.microsoft.com/RiaServices/Release/ProjectReleases.aspx?ReleaseId=2387)
which doesn't contain the mdf
Thanks
Fred

Saravana wrote  Jan 27 at 9:41 AM  
Regarding: Inheritance Documentation. You very first basic example 1.1.1 Basic Inheritance Hierarchy, doesn't work with VS 2008. I'm getting the error
Type 'RIAInheritance.Web.Services.PremiumCustomer' is a direct or indirect subclass of Type 'RIAInheritance.Web.Services.Customer'. DomainServices cannot return a Type that is a subclass of another Type returned from the same DomainService.

Am I missing something here. I'm currently exposing RIA services on top of complex POCO hierarchy. I got complex inheritance scenarios to deal with, but thought of isolating the problem and work with your basic example. Any help greatly appreciated.

Regards,
Saravana Kumar

Updating...
Page view tracker