Using Visual Studio 2013:
Select: New Project --> Visual C# --> Web --> ASP.NET MVC 5 Web Application
Give your Project a Friendly Name.
Browse to a good location for your Local Workspace.
Click Create.
Your MVC 5 application will scaffold and load into Visual Studio.
Click RUN.
Your project should compile and you should see a Sample Website in your browser.
Click STOP.
Right Click on your Project in Solution Explorer.
Select: Add --> Folder.
Name the folder Controllers.API (this important step will create a namespace container for your API controllers).
Right-click the Controllers.API folder.
Select: Add --> New Scaffolded Item.
Select: Common --> MVC --> WebAPI --> Web API 2 Controller......
(NOTE: If you do not have the WebAPI option, you will need to install a NuGet package for Microsoft ASP.NET Web API 2.2)
Click ADD.
Open App_Start/WebApiConfig.cs.
Paste the following into the Register() method:
No comments:
Post a Comment