Search Wiki:

.NET RIA Services


Microsoft .NET RIA Services simplifies the traditional n-tier application pattern by bringing together the ASP.NET and Silverlight platforms. RIA Services provides a 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.

Please use the forums to provide feedback or post questions.

To get started install the .NET RIA Service Package

To learn more about .NET RIA Services, please check out the samples below. An overview document can be downloaded from here .NET RIA Service Package
To provide feedback on the product please use the .NET RIA Services Feedback Forum

Here are some links to talks and blog post:-
1. What is .NET RIA Services?
2. .NET RIA Services - From Vision to Architecture
3. Building Business application with SL3 Talk
4. .NET RIA Services Talk

.NET RIA Services Walkthrough Sample

This sample is the completed .NET RIA Services walkthrough project mentioned in the documentation that comes with the .NET RIA Services preview install which can be downloaded from .NET RIA Services Preview install

Click here to download: .NET RIA Services Walkthrough Sample

HRAppCS
C# version of the walkthrough sample.

HRAppVB
VB.NET version of the walkthrough sample.

Database setup
This sample uses AdventureWorks database which can be downloaded from AdventureWorks database

Instructions for running the sample
  • Copy the sources from the zip file
  • Open the HRAppCS.sln (or HRAppVB.sln) file in Visual Studio.NET 2008 SP1
  • Set startup project to be HRApp.Web project in Solution Explorer
  • Set startup page to be HRAppTestPage.aspx in Solution Explorer
  • Add the database file AdventureWorksdata.mdf file to HRApp.Web\AppData folder
  • Ctrl + F5 to run the sample

Repository for unit testing sample

This sample demonstrates how DAL layer can be mocked to unit test business logic code implemented in DomainService class. This is done my implementing a repository pattern. Specifically the sample demonstrates implementing repository pattern with Linq To SQL as DAL and shows how it can be mocked for unit testing.

This sample uses the Walkthrough project above as the starting point for implementation.

Click here to download: Repository for unit testing sample

Database setup
This sample uses AdventureWorks database which can be downloaded from AdventureWorks database


Instructions for running the sample
  • Copy the sources from the zip file
  • Open the HRAppCS.sln file in Visual Studio.NET 2008 SP1
  • Set startup project to be HRApp.Web project in Solution Explorer
  • Set startup page to be default.html in Solution Explorer
  • Add the database file AdventureWorksdata.mdf file to HRApp.Web\AppData folder
  • Ctrl + F5 to run the sample

Instructions for running the unit tests

The sample uses Visual Studio Team Test 2008 project for creating unit tests.

  • Open HRAppCS.vsmdi from 'Solution Items' in SolutionExplorer
  • Select the tests you want to run
  • Click 'Test' menu and select 'Run tests in current context'

XML Metadata Provider

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

Click here to download: XML Metadata Provider

Linq to SQL DomainService Sample

This sample demonstrates how to create a .NET RIA Services DomainService base class for a particular data source or DAL (Data Access Layer). Two such providers are provided by the framework already – the LinqToSql and LinqToEntities DomainService base classes. All the APIs and functionality needed to create those DomainServices are public, which supports the creation of providers targeting other sources of data, for example NHibernate or other DALs, or an Amazon Web Services provider.

Click here to download: Linq to SQL DomainService Sample

Authentication Samples

These quick starts cover the default use cases of the Authentication Service in July Preview. While some show basic integration with ASP.NET, others tackle more complex scenarios including custom authentication, offline, 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 Samples

SilverlightStore SEO Example (CSharp)

This simple application demonstrates the use of XML data and a POCO (plain old CLR object) DomainService. The server-side use of the 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).

Click here to download: SilverlightStore SEO Example (CSharp)

Database setup
None. This example uses XML and LINQ to populate objects.

Instructions for running the sample
  • Copy the sources from the zip file
  • Open the SilverlightStore.sln file in Visual Studio.NET 2008 SP1
  • Set startup project to be SilverlightStore.Web project in Solution Explorer
  • Set startup page to be Default.aspx in Solution Explorer
  • Ctrl + F5 to run the sample


Classifieds Sample

CyclingClassifieds sample is an ad-sharing intranet Web-application that lets users browse existing ads and post new ads. This sample demonstrates the features in .NET RIA Services and Silverlight 3 to write Business centric application.

Click here to download: Classifieds Sample

Database setup
This sample uses SQL Server 2008 local database file. You need SQL Server 2008 Express installed to run this application, which can be downloaded from here

Instructions for running the sample
  • Copy the sources from the zip file
  • Open the CyclingClassifieds.sln file in Visual Studio.NET 2008 SP1
  • Set startup project to be CyclingClassifieds.Web project in Solution Explorer
  • Ctrl + F5 to run the sample
Last edited Jul 14 at 5:27 PM  by VijayUpadya, version 30
Comments
Matloob wrote  Apr 16 at 9:38 AM  
I had downloaded the "Microsoft .NET RIA Services Overview, MIX 2009 Preview" (the pdf) and was following the walkthrough. I noticed that when I tried to add a new record, the new record would not get written to the database. The same is the case with the HRAppCS code sample, .i.e., new records are not getting written to the database!

I had found out trying to debug my code that the InsertXXX() method never gets called. Am I right? If not, what's wrong with your code? (we may be making the same mistake :))

Regards
Matloob ul Hasan

lroal wrote  May 30 at 7:44 PM  
I have also tested HRAppCS code sample. The new record is NOT inserted in the database. You need to publish a new sample with this thing fixed

bilberry71 wrote  Jun 26 at 1:31 PM  
lroal wrote May 30 at 9:44 PM
>I have also tested HRAppCS code sample. The new record is NOT inserted in the database. You need to publish a new sample with this thing fixed
Is there anybody out there? Is there any fix? Is Silverlight alive or like MJackson?

22khz wrote  Jul 26 at 1:39 PM  
Hi. I just started a new business application project, everything was OK. But when I tried creating a new business app a Microsoft Visual Studio error occurred:

Error: this template attempted to load an untrusted component 'RiaServices.Preview.VisualStudio, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1dd0be75816bbb62, Custom=null'. For more information on this problem and how to enable this template, please see documentation on Customizing Project Templates.

Why is this happening? Any fix for this?

22khz wrote  Jul 26 at 1:47 PM  
Haha..found it. I was using the Silverlight Business Application template under My Templates view instead of the Visual Studio installed templates.. Kind of odd though.
Glad I nailed it :)

MartinKruszynski wrote  Oct 8 at 6:53 AM  
I don't understand how Offline Authentication Sample works. I get almost all buttons disabled. WindowsOfflineAuthentication extends WindowsAuthentication, so what about users such as customer! (and ASPNETDB.MDF file attached in web application) that are'nt Windows users ? How can I log in this sample?

saravanan_gs wrote  Oct 21 at 10:36 AM  
Hi, any code help on [RequiresRoles("")] attrib. implementation with CustomAuthenticationSample is highly appreciated.

Updating...
Page view tracker