ObjectPoolProvider.Create 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Create<T>() |
创建 ObjectPool。 |
Create<T>(IPooledObjectPolicy<T>) |
创建具有给定 IPooledObjectPolicy<T> 的 ObjectPool。 |
Create<T>()
- Source:
- ObjectPoolProvider.cs
- Source:
- ObjectPoolProvider.cs
- Source:
- ObjectPoolProvider.cs
创建 ObjectPool。
public:
generic <typename T>
where T : class, gcnew() Microsoft::Extensions::ObjectPool::ObjectPool<T> ^ Create();
public Microsoft.Extensions.ObjectPool.ObjectPool<T> Create<T> () where T : class, new();
member this.Create : unit -> Microsoft.Extensions.ObjectPool.ObjectPool<'T (requires 'T : null and 'T : (new : unit -> 'T))> (requires 'T : null and 'T : (new : unit -> 'T))
Public Function Create(Of T As {Class, New}) () As ObjectPool(Of T)
类型参数
- T
要为其创建池的类型。
返回
适用于
Create<T>(IPooledObjectPolicy<T>)
- Source:
- ObjectPoolProvider.cs
- Source:
- ObjectPoolProvider.cs
- Source:
- ObjectPoolProvider.cs
创建具有给定 IPooledObjectPolicy<T> 的 ObjectPool。
public:
generic <typename T>
where T : class abstract Microsoft::Extensions::ObjectPool::ObjectPool<T> ^ Create(Microsoft::Extensions::ObjectPool::IPooledObjectPolicy<T> ^ policy);
public abstract Microsoft.Extensions.ObjectPool.ObjectPool<T> Create<T> (Microsoft.Extensions.ObjectPool.IPooledObjectPolicy<T> policy) where T : class;
abstract member Create : Microsoft.Extensions.ObjectPool.IPooledObjectPolicy<'T (requires 'T : null)> -> Microsoft.Extensions.ObjectPool.ObjectPool<'T (requires 'T : null)> (requires 'T : null)
Public MustOverride Function Create(Of T As Class) (policy As IPooledObjectPolicy(Of T)) As ObjectPool(Of T)
类型参数
- T
要为其创建池的类型。
参数
- policy
- IPooledObjectPolicy<T>