ActivatorUtilities.CreateFactory Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
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 argumentTypes
tü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
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin