ActivatorUtilities.CreateFactory Yöntem

Tanım

Aşırı Yüklemeler

CreateFactory(Type, Type[])

Doğrudan ve/veya bir IServiceProvidersağlanmış oluşturucu bağımsız değişkenleriyle bir tür örneği oluşturacak bir temsilci oluşturun.

CreateFactory<T>(Type[])

Doğrudan veya bir IServiceProvidersağlanmış oluşturucu bağımsız değişkenleriyle bir tür örneği oluşturacak bir temsilci oluşturur.

CreateFactory(Type, Type[])

Kaynak:
ActivatorUtilities.cs
Kaynak:
ActivatorUtilities.cs
Kaynak:
ActivatorUtilities.cs
Kaynak:
ActivatorUtilities.cs
Kaynak:
ActivatorUtilities.cs

Doğrudan ve/veya bir IServiceProvidersağlanmış oluşturucu bağımsız değişkenleriyle bir tür örneği oluşturacak bir temsilci oluşturun.

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

Parametreler

instanceType
Type

Etkinleştirecek tür.

argumentTypes
Type[]

Döndürülen işleve ikinci parametresi olarak geçirilecek sırasıyla nesne türleri

Döndürülenler

 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

.

Şunlara uygulanır

CreateFactory<T>(Type[])

Kaynak:
ActivatorUtilities.cs
Kaynak:
ActivatorUtilities.cs
Kaynak:
ActivatorUtilities.cs
Kaynak:
ActivatorUtilities.cs

Doğrudan veya bir IServiceProvidersağlanmış oluşturucu bağımsız değişkenleriyle bir tür örneği oluşturacak bir temsilci oluşturur.

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)

Tür Parametreleri

T

Etkinleştirecek tür.

Parametreler

argumentTypes
Type[]

Döndürülen işleve ikinci parametresi olarak geçirilecek sırasıyla nesne türleri.

Döndürülenler

IServiceProvider ve argumentTypesiçinde tanımlanan türlere uyan nesneleri içeren bir bağımsız değişken dizisi kullanarak tür T örneği oluşturacak fabrika.

Şunlara uygulanır