哪里是IHttpControllerFactory? [英] Where is IHttpControllerFactory?

查看:123
本文介绍了哪里是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屋!

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