Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Is there any way to automatically generate Web API in c#.
I need to a way through which webapi controller.cs can automatically be generated. Is there any tool or any other suggestion will help
Posted
Comments
Afzaal Ahmad Zeeshan 31-Jul-15 16:53pm    
No, there isn't any tool.
Sreekanth Mothukuru 1-Aug-15 2:10am    
I think there should be a way to scaffolding api with a model!! but not sure.

1 solution

In MVC 5 you can scaffold Web API controller using your model class.

Please follow the steps below:

1. Right click on Controllers and Select Web API 2 Controller with actions, using Entity Framework.
2. Click Add button and provide the name of the model class, database context and api controller name.
3. Click Add button and the API controller will be generated with the CRUD methods for your database table.

Hope this will help.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900