コード例 #1
0
ファイル: Program.cs プロジェクト: l5071134/AopSolutions
        private static void TestAopWrapper()
        {
            ISimpleService svc = AOPFactory.CreateInstance <OtherService, ISimpleService>(1);

            svc.Execute();
            var rst = svc.GetResult();

            Console.WriteLine("执行结果为:" + rst);
            AOPFactory.Save();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: l5071134/AopSolutions
        static void Main(string[] args)
        {
            var test  = AOPFactory.CreateInstance <Test, ITest>();
            var test2 = AOPFactory.CreateInstance <Test>();

            var t = test.GetAll <int>(null);

            Console.WriteLine(t.Result);
            test.Write();

            int i = 5;

            test.Write(i);
            Console.WriteLine(i);


            string s = "1";

            test.Write(ref s);
            Console.WriteLine(s);

            test.Write2(out s);
            Console.WriteLine(s);

            test.Write(out i);
            Console.WriteLine(i);

            test.Write2222(out i);
            Console.WriteLine(i);

            object o = false;

            test.Write(out o);
            Console.WriteLine(o);


            var userSvc = AOPFactory.CreateInstance <UserService, IUserService>(new RepositoryContext(), new Repository <User>());
            var flag    = userSvc.Delete(Guid.NewGuid());
            var model   = userSvc.GetAll();
            var a       = userSvc.Add(new UserModel());
            var b       = userSvc.Get();
            var c       = userSvc.GetByID(Guid.NewGuid());
            var d       = userSvc.GetOne();
            var e       = userSvc.GetPage(1, 10);
            var f       = userSvc.Update(new UserModel());

            Console.WriteLine(model.Result);
            Console.WriteLine(e.Result);


            AOPFactory.Save();
            Console.Read();
        }