WCF RIA Services.
In Silverlight project you can turn on WCF RIA Services Link. This WCF RIA Services link connects Silverlight client Application and Web Project.
WCR RIA Service simplify the N-tier development and it allow to share Data model, Validation Rules and other Data annotations across tiers. what ever methods or Entities which are add in Server Side its replicates to client side application this makes easy access to server side entities. We Add Domain Service class to expose WCF RIA Service on Server side. When you compile the project it automatically creates corresponding Domain Context class in client application this Class helps to tracking changes and CURD operations of Entities.
Here I am going to build Simple Application which uses WCF RIA Services.
1) Fire up VS.NET 2010 and Create SilverLight Business Application.
This project Creates two application one is Silverlight client project and web project as shown below. This to projects connected or Linked using WCF RIA Services.
Now I am going to add EF model from one of the sample Database which you can download from CodePlex.
Now follow the Wizard.
Next we are going to select Generate From Database options. Here we are going to generate our model from Existing Database.
Select Database which you wanted to use here I am going to use Chinook Sample DB.
Here we need to select the Tables which you wanted to add to our EF Model. Here I am going to select Customer and Employee Tables.
Now we have created our model. At this point we need to compile our project so that Silverlight application will know the new changes to our solutions. Now we need to Add Domain Service Class.
Please make sure that next step you check the checkboxes as shown below. Here I am enabling Editing options for both Customer and Employee entities.
Now we can start building UI to display Customer records on client side. Now select Data Source and click and select DataGrid then Drag and Drop Customer To UI Design Surface.
At this point VS.NET created Domain Data Source control. as shown below.