ActivatorUtilities.CreateFactory Yöntem

Tanım

Aşırı Yüklemeler

CreateFactory(Type, Type[])

Doğrudan ve/veya öğesinden sağlanan oluşturucu bağımsız değişkenleriyle bir tür örneği oluşturacak bir IServiceProvidertemsilci oluşturun.

CreateFactory<T>(Type[])

Doğrudan veya öğesinden sağlanan oluşturucu bağımsız değişkenleriyle bir tür örneği oluşturacak bir IServiceProvidertemsilci oluşturur.

CreateFactory(Type, Type[])

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

Doğrudan ve/veya öğesinden sağlanan oluşturucu bağımsız değişkenleriyle bir tür örneği oluşturacak bir IServiceProvidertemsilci 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 nesne türleri sırasıyla

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 öğesinden sağlanan oluşturucu bağımsız değişkenleriyle bir tür örneği oluşturacak bir IServiceProvidertemsilci 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 nesne türleri sırayla.

Döndürülenler

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

Şunlara uygulanır