你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ConfigBuilder.ConfigureWebApiDependencyResolver 方法

定义

初始化依赖项解析程序。

protected virtual System.Web.Http.Dependencies.IDependencyResolver ConfigureWebApiDependencyResolver (System.Web.Http.HttpConfiguration config, System.Collections.Generic.IDictionary<Type,object> serviceInstances);
abstract member ConfigureWebApiDependencyResolver : System.Web.Http.HttpConfiguration * System.Collections.Generic.IDictionary<Type, obj> -> System.Web.Http.Dependencies.IDependencyResolver
override this.ConfigureWebApiDependencyResolver : System.Web.Http.HttpConfiguration * System.Collections.Generic.IDictionary<Type, obj> -> System.Web.Http.Dependencies.IDependencyResolver
Protected Overridable Function ConfigureWebApiDependencyResolver (config As HttpConfiguration, serviceInstances As IDictionary(Of Type, Object)) As IDependencyResolver

参数

config
System.Web.Http.HttpConfiguration

当前的 System.Web.Http.HttpConfiguration 实例。

serviceInstances
IDictionary<Type,Object>

服务正常运行所需的依赖项集。 应注册这些依赖项,以便在请求时可供服务使用。

返回

System.Web.Http.Dependencies.IDependencyResolver

System.Web.Http.Dependencies.IDependencyResolver 用于此服务的 。

适用于