Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("特性和AOP");
                People    people    = new People();
                UserModel userModel = new UserModel();
                userModel.Id = 23;
                string remark = userModel.GetTableName();
                BaseDAL.Save <UserModel>(userModel);

                #region AOP show

                Console.WriteLine("***********************");
                Decorator.Show();

                Console.WriteLine("***********************");
                Proxy.Show();

                Console.WriteLine("***********************");
                CastleProxy.Show();

                Console.WriteLine("***********************");
                UnityAOP.Show();

                #endregion
            }
            catch (Exception)
            {
                throw;
            }
            Console.Read();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("欢迎来到.net高级班vip课程,今天的内容是特性和AOP");
                People people = new People();

                UserModel user = new UserModel();
                user.Id = 1;

                string name = user.GetTableName <UserModel>();

                string remark = UserState.Normal.GetRemark();

                BaseDAL.Save <UserModel>(user);


                #region AOP show
                Console.WriteLine("***********************");
                Decorator.Show();
                Console.WriteLine("***********************");
                Proxy.Show();
                Console.WriteLine("***********************");
                CastleProxy.Show();
                Console.WriteLine("***********************");
                UnityAOP.Show();
                #endregion
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.Read();
        }