[AttributeUsage(AttributeTargets.Class,Inherited=true,AllowMultiple=false)]
    public class TestAttribute:Attribute
    {
        private string _author;
        public TestAttribute(string author)
        {
            _author = author;
        }
        public bool CheckKey()
        {
            if (this._author.StartsWith("A") && this._author.EndsWith("D"))
                return true;
            else
                return false;
        }
    }
    [Serializable]
    [Test("ABCD")]    
    public class Fruit
    {
        [RegularExpression("(a-z){1,5}$",ErrorMessage="种类错误")]
        public string FruitKind;
        [Range(1,100,ErrorMessage="价格离谱")]
        public int price;
    } 那么在实例Fruit中,应该怎么应用这些属性呢?
   
    class Program
    {
        static void Main(string[] args)
        {
            Fruit f = new Fruit();
            f.FruitKind = "apple";
            f.price = 10;
            Type type = f.GetType();
            //1、怎么反射并判断利用Test的CheckKey属性呢?
            //2、怎么判断f的FruitKind、price是否违反类中的属性定义?(类似mvc中的ModelState.IsValid方式)
        }
    }