ActivatorUtilities.CreateFactory Metoda

Definicja

Przeciążenia

CreateFactory(Type, Type[])

Utwórz delegata, który utworzy wystąpienie typu z argumentami konstruktora podanymi bezpośrednio i/lub z .IServiceProvider

CreateFactory<T>(Type[])

Tworzy delegata, który utworzy wystąpienie typu z argumentami konstruktora podanymi bezpośrednio lub z klasy IServiceProvider.

CreateFactory(Type, Type[])

Źródło:
ActivatorUtilities.cs
Źródło:
ActivatorUtilities.cs
Źródło:
ActivatorUtilities.cs
Źródło:
ActivatorUtilities.cs
Źródło:
ActivatorUtilities.cs

Utwórz delegata, który utworzy wystąpienie typu z argumentami konstruktora podanymi bezpośrednio i/lub z .IServiceProvider

public:
 static Microsoft::Extensions::DependencyInjection::ObjectFactory ^ CreateFactory(Type ^ instanceType, cli::array <Type ^> ^ argumentTypes);
public static Microsoft.Extensions.DependencyInjection.ObjectFactory CreateFactory (Type instanceType, Type[] argumentTypes);
static member CreateFactory : Type * Type[] -> Microsoft.Extensions.DependencyInjection.ObjectFactory
Public Shared Function CreateFactory (instanceType As Type, argumentTypes As Type()) As ObjectFactory

Parametry

instanceType
Type

Typ do aktywowania.

argumentTypes
Type[]

Typy obiektów w kolejności, które zostaną przekazane do zwracanej funkcji jako drugi parametr

Zwraca

 A factory that will instantiate instanceType using an <xref data-throw-if-not-resolved="true" uid="System.IServiceProvider"></xref>
 and an argument array containing objects matching the types defined in argumentTypes

.

Dotyczy

CreateFactory<T>(Type[])

Źródło:
ActivatorUtilities.cs
Źródło:
ActivatorUtilities.cs
Źródło:
ActivatorUtilities.cs
Źródło:
ActivatorUtilities.cs

Tworzy delegata, który utworzy wystąpienie typu z argumentami konstruktora podanymi bezpośrednio lub z klasy IServiceProvider.

public:
generic <typename T>
 static Microsoft::Extensions::DependencyInjection::ObjectFactory<T> ^ CreateFactory(cli::array <Type ^> ^ argumentTypes);
public static Microsoft.Extensions.DependencyInjection.ObjectFactory<T> CreateFactory<T> (Type[] argumentTypes);
static member CreateFactory : Type[] -> Microsoft.Extensions.DependencyInjection.ObjectFactory<'T>
Public Shared Function CreateFactory(Of T) (argumentTypes As Type()) As ObjectFactory(Of T)

Parametry typu

T

Typ do aktywowania.

Parametry

argumentTypes
Type[]

Typy obiektów, w kolejności, które zostaną przekazane do zwróconej funkcji jako drugi parametr.

Zwraca

Fabryka, która utworzy wystąpienie typu T przy użyciu tablicy argumentów IServiceProvider i zawierającej obiekty pasujące do typów zdefiniowanych w obiekcie argumentTypes.

Dotyczy