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 ASP.NET Web API Service when the domain model changes. For example, you add new tables in the database and update your domain model. In this case, you will need to update your ASP.NET Web API Service to generate the new controllers.
Updating a ASP.NET Web API Service
Suppose, you have added new tables 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 ASP.NET Web API Service to expose the new controllers. The image below shows a sample Web solution with Telerik Data Access Domain Model and ASP.NET Web API Service generated using the Service Wizard.
To regenerate your ASP.NET Web API 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. ASP.NET Web API 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.
- Build your solution.