ServiceContainer.GetService(Type) 方法

定义

获取请求的服务。

public:
 virtual System::Object ^ GetService(Type ^ serviceType);
public virtual object GetService (Type serviceType);
public virtual object? GetService (Type serviceType);
public object GetService (Type serviceType);
abstract member GetService : Type -> obj
override this.GetService : Type -> obj
Public Overridable Function GetService (serviceType As Type) As Object
Public Function GetService (serviceType As Type) As Object

参数

serviceType
Type

要检索的服务类型。

返回

如果可以找到服务,则为该服务的实例;如果未能找到服务,则为 null

实现

适用于

另请参阅