How to: Update the Generated Service
This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.
This topic describes how to update your WCF Plain 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 Plain Service to expose the new entities and properties.
Updating a WCF Plain Service
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 Plain Service to expose the updated model. The image below shows a sample Web solution with Telerik Data Access Domain Model and WCF Plain Service generated using the Service Wizard.
To regenerate your WCF Plain Service:
- Build your solution and run the Service Wizard.
- On the Select Source and Output use the same configuration as the previous generation of the service.
- On the Select Service Type dialog, select the same service type, e.g. WCF Plain Service.
- On the Service Configuration dialog, check all entities that should be exposed by the service, not only the newly added. Set the same service name as the name of the original service. This is the name of the generated service class. E.g. you can see the name of the service class in the EntitiesModelService.svc.cs file.
-
When you click next, you should be presented with the following dialog asking whether you want to replace the existing service files. Click Generate and Replace for all conflicts.
On the final page, click Finish to re-generate the service.
Updating the Service Reference on the Client
Regenerating your WCF Plain Service is the first step. The second step is to update the Service Reference in the client project. You could do that directly in Solution Explorer. Right click the generated service reference and select Update Service Reference.