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>()

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

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>()

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

public:
generic <typename T>
 T GetService();
public T GetService<T> ();
Public Function GetService(Of T) () As T
Type Parameters
T

The type of the service object.

Returns

The specified type of service object to get.

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);
Public Function GetService(Of T) (throwIfNotFound As Boolean) As T
Type Parameters
T

The generic type value.

Parameters
throwIfNotFound
Boolean Boolean Boolean

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

Returns

A service object of type serviceType.

Applies to