Condividi tramite


FunctionActivatorExtensions.CreateInstance<T> Method

Definition

Creates an instance of the specified generic type argument, T, to be used as the target of the invocation.

public static T? CreateInstance<T> (this Microsoft.Azure.Functions.Worker.IFunctionActivator activator, Microsoft.Azure.Functions.Worker.FunctionContext context) where T : class;
static member CreateInstance : Microsoft.Azure.Functions.Worker.IFunctionActivator * Microsoft.Azure.Functions.Worker.FunctionContext -> 'T (requires 'T : null)
<Extension()>
Public Function CreateInstance(Of T As Class) (activator As IFunctionActivator, context As FunctionContext) As T

Type Parameters

T

The type of the instance to create.

Parameters

activator
IFunctionActivator

The IFunctionActivator instance to use when creating the instance.

context
FunctionContext

The FunctionContext for the invocation triggering the instance creation.

Returns

T

The created instance.

Applies to