public TProxy CreateProxy <TProxy>(TProxy obj, Predicate <MethodInfo> methodIncluder, ILock theLock) where TProxy : class { if (obj == null) { throw new ArgumentNullException("obj"); } if (methodIncluder == null) { throw new ArgumentNullException("methodIncluder"); } if (theLock == null) { throw new ArgumentNullException("theLock"); } if (!_proxyGenerator.CanProxy <TProxy>()) { throw new ArgumentException(string.Format(ExceptionMessages.ObjectNotSupportedByProxyGeneratorFormat, typeof(TProxy).FullName)); } var interceptor = _threadSafeInterceptorFactory.CreateInterceptor(theLock, methodIncluder); return(_proxyGenerator.Generate(obj, interceptor)); }