Beispiel #1
0
        static OriginTest()
        {
            Func <string, int> action = item => item.Length + 1;

            //创建联合接口代理
            var proxier = new Proxier <TestInterface>();

            //proxier.UseSingleton();
            proxier["Get"] = "return value.Length;";
            //proxier["Get"] = action;
            _func     = proxier.GetDefaultCreator <TestInterface>();
            _instance = _func();
            for (int i = 0; i < 10000000; i++)
            {
                _func();
            }
            int value  = _instance.Get("jaja");
            var result = new TestModel();

            value = result.Get("jaja");
        }
Beispiel #2
0
 public void NatashaProxyInstance()
 {
     A = _instance.Get("jaja");
 }