This topic describes how to update your WCF RIA Service when the domain model changes. For example, you add new tables and columns in the database and update your domain model. In this case, you will need to update your WCF RIA Service to expose the new entities and properties.
Suppose, you have added new tables and columns in your database and you have reflected the changes in your domain model by using the Update from Database Wizard. The next step is to update your WCF RIA Service to expose the updated model. The image below shows a sample Silverlight solution with Telerik Data Access Domain Model and Telerik Data Access Domain Service.
To regenerate your WCF RIA Service:
- Build your solution.
- Add a new Telerik Data Access Domain Service with the same file name as the original (e.g. SofiaCarRentalDomainService.tt).
- On the Configure Domain Service Endpoints page, you need to set the same service name as the name of the original service. This is the name of the generated domain service class. E.g. you can see the name of the domain service class in the SofiaCarRentalDomainService.generated.cs file.
- On the same page check all entities that should be exposed by the service, not only the newly added.
Click Finish to generate the service. In the Destination File Exists dialog, click Yes to replace the service files.
In case your original ServiceName.tt file is open in the Visual Studio environment, you will receive the following error during the replacement:
So, before regenerating your WCF RIA Service, close the original ServiceName.tt file from the Visual Studio environment.