Beispiel #1
0
        static void Main(string[] args)
        {
            // 日志
            LogHelper.SetLogProvider(new NLogProvider());
            LogHelper.Debug("fdsfds", new Exception());

            //缓存
            CacheHelper.SetCacheProvider(new MemoryCacheProvider());
            CacheHelper.Set("aa", "sss");
            var ss = CacheHelper.Get("aa");

            Console.WriteLine(ss);

            //IOC
            IocHelper.SetIocProvider(new AutofacProvider());
            var test1 = IocHelper.GetInstance <Test1>();

            Console.WriteLine(test1.GetTest());

            //Json
            JsonSerializerHelper.SetJsonProvider(new FastJsonProvider());
            ss = test1.TestJson();
            Console.WriteLine(ss);
            Console.ReadKey();
        }