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.

RIA Services Home Page with links to the download site, MSDN docs, talks ... can be found here.

For help porting applications to the latest bits - Breaking Changes from Beta(PDC 09) to RTW
The document above also insludes guidance on updating VS 2008/.NET 3.5 RIA Services applications to VS 2010/.NET 4

Please use the forums to provide feedback or post questions.


Sample download instructions
Please note that once you have downloaded a Sample.zip from below to your machine, you need to right click on the .zip, go to the Property Page and explicitly UnBlock the content. Only then should you extract the .zip file.


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

Application Templates

Silverlight Business Application Templates using a modified Cosmopolitan Theme that looks like the Zune client.

Click here to download: Application Templates


Feature Samples


NHibernate Sample

This sample demonstrates a RIA Service's application working against NHibernate.

Click here to download: NHibernate Sample

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 some of the use cases for Authentication in RIA Services. While some show basic integration with ASP.NET, others tackle more complex scenarios including custom authentication, offline support, and Windows Live ID integration. “Quick Start” comments have been included in the source to highlight and explain the implementation.

Click here to download: Authentication Quick Starts

Authorization based dynamic UI and Navigation

This sample shows how to use client-side authorization to customize UI and authorize navigation through xaml markup. The main functionality is contained in a Silverlight library to make it portable and reusable. Included with this sample are guides that cover common scenarios to make client-side authorization easy to understand and implement.

Click here to download: Authorization based dynamic UI and Navigation

Authorization and Navigation Samples, Part 2

These samples build on the library included in part one and show how to implement Site-Map Navigation, Metadata-Aware Authorization, MVVM Authorization, and Permission-Based Authorization.

Click here to download: Authorization and Navigation Samples, Part 2

ComboBox Sample for RIA Services

This sample shows best practices for using the Silverlight ComboBox with RIA Services. It includes a small library of extensions to make the patterns easily reusable.

Click here to download: ComboBox Sample for RIA Services

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 Metadata Provider

This sample demonstrates how to create a custom DomainServiceDescriptionProvider that can participate in the RIA Services metadata pipeline to dynamically add entity metadata. Using this extensibility mechanism, the sample shows how metadata expressed externally (e.g. in an xml file or other external form) can be applied by the framework. This provides a way to add metadata to types that you can't modify by applying declarative attributes to directly.

Click here to download: Custom Metadata Provider

Archived VS 2008, NET 3.5, SL 3 Samples

WCF RIA Services RC bits only supports VS 2010, .NET 4 and SL 4.
More details on RIA Services platform support can be found here

Click here to download: Archived VS 2008, NET 3.5, SL 3 Samples

Integration with WCF Routing

This sample shows how to integrate WCF Routing (released in .Net 4) with RIA Services. Please keep in mind that in order for the sample works, you need the AdventureWorksLT database deployed to your local SQL Server Express instance... and don't forget to update the connection string in Web.config!

More details can be found here

Click here to download: Integration with WCF Routing

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]
Last edited Aug 24 at 7:50 AM  by Yavor, version 108
Comments
SaurabhPant wrote  May 17 at 6:45 PM  
Please use the RIA Services forums [http://silverlight.net/forums/53.aspx] to provide feedback on the samples above.
The forums are tracked by RIA Services team members and we will be better able to respond to your concerns there.

bmtahar wrote  Jun 8 at 9:18 AM  
hello
can you help me please,
I watch the video of module 2 on Channel 9 RIAServices in my application I can add and edit entities in my database but I can not find how to delete an entity.
example how to delete the selected row of the DataGrid.
thank you in advance.

SaurabhPant wrote  Jun 8 at 6:29 PM  
@bmtahar,
In the future please use ther RIA Services forum [http://silverlight.net/forums/53.aspx] for such questions. You will get a quicker response there.

We dont have a sampel that does exactly what you are lookign for but this post [http://jeffhandley.com/archive/2009/11/16/domaindatasourceview-again.aspx] shows the API for the DomainDataSource.DataView property, which includes a Remove method as well as a RemoveAt.

To remove the item that is currently selected in the DataGrid (assuming it’s bound to the DomainDataSource), you should be able to do:
myDataSource.DataView.Remove(myDataSource.DataView.CurrentItem);

Hope this helps ...

Fredzilla wrote  Jun 22 at 5:42 PM  
Typo: Windows Presentaion Foundation

Updating...
Page view tracker