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