ASP.NET Web API 2: Beginner Guide by Ambily K K

ASP.NET Web API 2: Beginner Guide by Ambily K K

Author:Ambily K K [K K, Ambily]
Language: eng
Format: epub, pdf
Published: 2015-03-21T22:00:00+00:00


Figure 9: Adding an entity data model based on the Course and Status tables

After we define the data model, we can generate the Web API controller that corresponds to the model. Rebuild the application to generate the code context corresponding to the EF data model. Right-click Controller and then click Add Controller, which lunches the Add Scaffold dialog box. Select the Web API 2 Controller with actions, using Entity Framework option and click Add.

Figure 10: Adding a controller based on the EF data model

This will open the Add Controller window. Select the Course model from the list of available models and select the container corresponding to the course model for Data Context.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.