Castle.DynamicProxy.Generators.ClassProxyGenerator.EnsureDoesNotImplementIProxyTargetAccessor C# (CSharp) Method

EnsureDoesNotImplementIProxyTargetAccessor() private method

private EnsureDoesNotImplementIProxyTargetAccessor ( Type type, string name ) : void
type System.Type
name string
return void
		private void EnsureDoesNotImplementIProxyTargetAccessor(Type type, string name)
		{
			if (!typeof(IProxyTargetAccessor).IsAssignableFrom(type))
			{
				return;
			}
			var message =
				string.Format(
					"Target type for the proxy implements {0} which is a DynamicProxy infrastructure interface and you should never implement it yourself. Are you trying to proxy an existing proxy?",
					typeof(IProxyTargetAccessor));
			throw new ArgumentException(message, name);
		}
	}