WebApiConfig.cs和RouteConfig.cs的区别 [英] Difference between WebApiConfig.cs and RouteConfig.cs

查看:1735
本文介绍了WebApiConfig.cs和RouteConfig.cs的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是 WebApiConfig.cs RouteConfig.cs App_Start之间的差异在Visual Studio 2012中的MVC的Web API项目的文件夹?

What is the difference between WebApiConfig.cs and RouteConfig.cs in the App_Start folder of an MVC Web API project in Visual Studio 2012?

推荐答案

以下是主要的区别:


  1. RouteConfig.cs是专为ASP.NET配置路线。

  2. WebApiConfig.cs为任何的Web API相关的配置,包括Web-API的具体路线,网页API服务,以及其他Web API设置。

由于cmotley提到,ASP.NET网站包括什么类型的配置可以在这篇文章

As cmotley mentions, the ASP.NET web site includes a good listing of what types of configuration can be done in WebApiConfig.cs in this article.

这篇关于WebApiConfig.cs和RouteConfig.cs的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆