共用方式為


ObjectPoolServiceCollectionExtensions.AddPooled 方法

定義

多載

AddPooled<TService,TImplementation>(IServiceCollection, Action<DependencyInjectionPoolOptions>)

ObjectPool<T>加入 ,並讓 DI 傳回 的範圍TService實例。

AddPooled<TService>(IServiceCollection, Action<DependencyInjectionPoolOptions>)

ObjectPool<T>加入 ,並讓 DI 傳回 的範圍TService實例。

AddPooled<TService,TImplementation>(IServiceCollection, Action<DependencyInjectionPoolOptions>)

來源:
ObjectPoolServiceCollectionExtensions.cs
來源:
ObjectPoolServiceCollectionExtensions.cs

ObjectPool<T>加入 ,並讓 DI 傳回 的範圍TService實例。

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddPooled<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.ObjectPool.DependencyInjectionPoolOptions>? configure = default) where TService : class where TImplementation : class, TService;
static member AddPooled : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.ObjectPool.DependencyInjectionPoolOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddPooled(Of TService As Class, TImplementation As Class) (services As IServiceCollection, Optional configure As Action(Of DependencyInjectionPoolOptions) = Nothing) As IServiceCollection

類型參數

TService

要集區的物件類型。

TImplementation

要使用的實作類型。

參數

services
IServiceCollection

要新增的目標 IServiceCollection

configure
Action<DependencyInjectionPoolOptions>

集區的設定。

傳回

提供的服務集合。

例外狀況

servicesnull

備註

默認容量為 1024。 從 DI 容器解析 ObjectPool<T> 可取得集區類型實例。

適用於

AddPooled<TService>(IServiceCollection, Action<DependencyInjectionPoolOptions>)

來源:
ObjectPoolServiceCollectionExtensions.cs
來源:
ObjectPoolServiceCollectionExtensions.cs

ObjectPool<T>加入 ,並讓 DI 傳回 的範圍TService實例。

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddPooled<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.ObjectPool.DependencyInjectionPoolOptions>? configure = default) where TService : class;
static member AddPooled : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.ObjectPool.DependencyInjectionPoolOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddPooled(Of TService As Class) (services As IServiceCollection, Optional configure As Action(Of DependencyInjectionPoolOptions) = Nothing) As IServiceCollection

類型參數

TService

要集區的物件類型。

參數

services
IServiceCollection

要新增的目標 IServiceCollection

configure
Action<DependencyInjectionPoolOptions>

用來設定集區選項的動作。

傳回

提供的服務集合。

例外狀況

servicesnull

備註

默認容量為 1024。 從 DI 容器解析 ObjectPool<T> 可取得集區類型實例。

適用於