问题描述
什么是创建使用ASP.NET MVC的Visual Studio 2013一个简单的REST API的最佳方式。
What is the best way to create a simple REST API in Visual Studio 2013 using ASP.NET MVC.
我只是想用控制器和路线配置的东西有一个HTTP REST API的任何其它基本要求一起。
I just want something with controllers and route config along with any other basic requirements for a HTTP REST API.
我不需要任何的Razor视图引擎,JavaScript或HTML的夹杂物。
I don't require any Razor view engine, Javascript or HTML inclusions.
我怎样才能创建一个没有所有不需要额外的一个项目,这是我平时在过去删除?
How can I create a project without all the unwanted extras, which I usually remove in the past?
感谢您。
推荐答案
这一切都在您选择的模板。
It's all in the template you select.
- 在新建项目对话框中,选择.NET框架4.5如果尚未选中
- 导航到安装>模板>的Visual C#>网络,然后选择ASP.NET Web应用程序,然后选择确定。
- 在对话框中选择项目类型,选择清空,但一定要检查的Web API的添加文件夹和核心引用下。
现在你将有裸露最低创建。
Now you'll have the bare minimums created.
请参阅:http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api
这篇关于简单的Web API REST项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!