IServiceProviderEx.GetService IServiceProviderEx.GetService IServiceProviderEx.GetService IServiceProviderEx.GetService Method

Definition

Initializes an object that specifies the type of service object to get.

Overloads

GetService<T>() GetService<T>() GetService<T>() GetService<T>()

Retrieves an object that specifies the type of service object to get.

GetService<T>(Boolean) GetService<T>(Boolean) GetService<T>(Boolean) GetService<T>(Boolean)

Specifies a value that indicates the type of service object to get.

GetService<T>() GetService<T>() GetService<T>() GetService<T>()

Retrieves an object that specifies the type of service object to get.

public:
generic <typename T>
 T GetService();
public T GetService<T> ();
abstract member GetService : unit -> 'T
Public Function GetService(Of T) () As T

Type Parameters

T

The type of the service object.

Returns

T T T T

The specified type of service object to get.

GetService<T>(Boolean) GetService<T>(Boolean) GetService<T>(Boolean) GetService<T>(Boolean)

Specifies a value that indicates the type of service object to get.

public:
generic <typename T>
 T GetService(bool throwIfNotFound);
public T GetService<T> (bool throwIfNotFound);
abstract member GetService : bool -> 'T
Public Function GetService(Of T) (throwIfNotFound As Boolean) As T

Type Parameters

T

The generic type value.

Parameters

throwIfNotFound
Boolean Boolean Boolean Boolean

true if the service is not found; otherwise, false.

Returns

T T T T

A service object of type serviceType.

Applies to