Esempio n. 1
0
        public static object CreateProxy(Type from, Type realProxyType)
        {
            var  generator = new DynamicProxyGenerator(realProxyType, from);
            Type type      = generator.GenerateType();

            return(Activator.CreateInstance(type));
        }
Esempio n. 2
0
        public static T CreateProxy <T>(Type realProxyType)
        {
            var  generator = new DynamicProxyGenerator(realProxyType, typeof(T));
            Type type      = generator.GenerateType();

            return((T)Activator.CreateInstance(type));
        }