static void Main(string[] args) { Student student = new Student() { Id = 8, Name = "王杰" }; VipStudent vip = new VipStudent() { Id = 2, Name = "ks" }; FreeStudent free = new FreeStudent() { Id = 22, Name = "免费的福哥" }; AttributeInvoke.Show <Student>(student); Console.WriteLine("========================="); AttributeInvoke.Show <VipStudent>(vip); Console.WriteLine("========================="); AttributeInvoke.Show <FreeStudent>(free); Console.WriteLine("========================="); UnityAOP.Show(); //logger.Error("测试异常", null); Console.ReadKey(); }
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(); }
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(); }
static void Main(string[] args) { try { //People people = new People(); //people.Id = 1; UserModel user = new UserModel(); string name = user.TableName <UserModel>(); Console.WriteLine(name); Console.WriteLine(CommonEnum.UserState.Normal.GetRemark()); UnityAOP.Show(); Console.ReadKey(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }