/// <summary> /// Starts setting up a passthrough object /// </summary> /// <param name="innerType">Inner object type</param> /// <returns></returns> public Passthrough Create(Type innerType) { object inner = Activator.CreateInstance(innerType); _interceptor = new PassthroughInterceptor(inner); return(this); }
internal static T As <T>(PassthroughInterceptor passthrough) { T proxy = default(T); Type type = passthrough.Inner.GetType(); proxy = GenerateProxy <T>(type, passthrough); return(proxy); }
private static TInterface GenerateProxy <TInterface>(Type type, PassthroughInterceptor passthrough) { ProxyGenerator generator = GetProxyGenerator(type); return(generator.CreateInterfaceProxyWithoutTarget <TInterface>(passthrough)); }
public Passthrough Create(object inner) { _interceptor = new PassthroughInterceptor(inner); return(this); }