/// <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); }
/// <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); }