ActivityExecutionContext.GetService Method

Definition

Overloads

GetService(Type)

Returns a service of the specified type.

GetService<T>()

Returns a service provider of the specified Type.

GetService(Type)

Returns a service of the specified type.

C#
public object GetService(Type serviceType);

Parameters

serviceType
Type

The Type of the service.

Returns

A service Object of the specified Type.

Implements

Exceptions

Applies to

.NET Framework 4.8.1 ja muut versiot
Tuote Versiot
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetService<T>()

Returns a service provider of the specified Type.

C#
public T GetService<T>();

Type Parameters

T

The specified type for which the provider is to be returned.

Returns

T

A service provider Object of the specified Type.

Exceptions

Applies to

.NET Framework 4.8.1 ja muut versiot
Tuote Versiot
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1