哪里是IHttpControllerFactory? [英] Where is IHttpControllerFactory?
问题描述
微软网站说,有一个<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.http.dispatcher.ihttpcontrollerfactory%28v=vs.108%29.aspx\"相对=nofollow> IHttpControllerFactory 可用于产生定制的方式控制器。
Microsoft website says there is a IHttpControllerFactory which can be used to generate controllers in custom ways.
不过,System.Web.Http DLL从Visual Studio中引用:
的包\\ Microsoft.AspNet.WebApi.Core.4.0.20710.0 \\ lib目录\\ net40 \\ System.Web.Http.dll 的
However, the System.Web.Http DLL referenced from Visual Studio: packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll
不具有接口:
那么,是接口呢?
推荐答案
它不见了,取而代之的是一个的 依赖解析器
或更具体的<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.http.dependencies.idependencyresolver%28v=vs.108%29.aspx\"相对=nofollow> 的IDependencyResolver
接口。一旦你写你自己的依赖的决心,你可以将其插入到Web API:
It's gone and replaced by a dependency resolver
or more specifically the IDependencyResolver
interface. Once you write your own dependency resolve you could plug it into the Web API:
config.DependencyResolver = new MyDependencyResolver();
这篇关于哪里是IHttpControllerFactory?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!