예제 #1
0
 /// <summary>
 /// Register this policy for object pool safety
 /// </summary>
 /// <param name="policy"></param>
 public static void SafeRegister(this IPolicy policy)
 {
     if (policy is null)
     {
         return;
     }
     if (ObjectPoolManager.Contains(policy.BindingType))
     {
         return;
     }
     ObjectPoolManager.Create(policy);
 }
예제 #2
0
 /// <summary>
 /// Register this policy for object pool safety
 /// </summary>
 /// <param name="policy"></param>
 /// <typeparam name="T"></typeparam>
 public static void SafeRegister <T>(this IPolicy <T> policy)
 {
     if (policy is null)
     {
         return;
     }
     if (ObjectPoolManager.Contains <T>())
     {
         return;
     }
     ObjectPoolManager.Create(policy);
 }