如果我想使用 WebAPI 作为服务来连接到不同服务器上的多个数据库并检索我的 MVC 应用程序将使用的数据,那么最好的方法是什么?
我不希望 ApiController(s) 与我的 MVC 项目在同一个项目中,所以我需要添加一个新的 WebApi 项目(删除所有除了控制器和模板添加的东西以拥有一个干净的项目),我的 MVC 应用程序会参考吗?
这是我用来学习 WebAPI 的教程/博客文章列表:
ASP.NET Web API - 带有可下载示例代码的截屏系列 http://weblogs.asp.net/jgalloway/archive/2012/03/16/asp-net-web-api-screencast-series-with-downloadable-sample-代码部分 1.aspx
使用 HttpClient 使用 ASP.NET Web API 服务
http://debugmode.net/2012/03/03/creating-first-http-service-using-asp-net-web-api-part1-of-many/ http://debugmode.net/2012/03/ 07/消费-asp-net-web-api-service-using-httpclient-part2-of-many/
使用 ASP.NET Web API 和 MVC4 的 CRUD 操作
http://www.dotnetglobe.com/2012/03/crud-operation-using-aspnet-web-api-in.html http://www.dotnetglobe.com/2012/03/crud-operation-using-aspnet -web-api-in_28.html
为 ASP.Net Web API oData 服务创建一个 .Net 可查询客户端 http://blog.petegoo.com/index.php/2012/03/11/creating-a-net-queryable-client-for-asp-net- web-api-odata-服务/
使用 HttpClient 使用 ASP.NET Web API REST 服务 http://www.johnnycode.com/blog/2012/02/23/sumption-your-own-asp-net-web-api-rest-service/
ASP.NET Web API 的客户端支持 https://msmvps.com/blogs/theproblemsolver/archive/2012/03/13/client-side-support-with-the-asp-net-web-api.aspx
创建和使用 ASP.Net Web API REST 服务 - MVC4 http://www.askamoeba.com/Opensource/Opensourcedetail/144/Create-and-Consume-ASP-Net-Web-API-REST-Services-MVC4
使用 MediaTypeFormatter 和 OData 支持通过 ASP.NET Web API 构建和使用 REST 服务
将 JSON.NET 与 ASP.NET Web API 结合使用
http://blogs.msdn.com/b/henrikn/archive/2012/02/18/using-json-net-with-asp-net-web-api.aspx
在 ASP.NET Web API 中为逗号分隔值 (CSV) 格式创建自定义 CSVMediaTypeFormatter
在 ASP.NET Web API 中实现 CORS 支持
我如何看待 Web API