var props = t.GetProperties().Where( prop => Attribute.IsDefined(prop, typeof(MyAttribute)));
这样避免了必须实现任何属性实例(即,它比便宜
GetCustomAttribute[s]()。

var props = t.GetProperties().Where( prop => Attribute.IsDefined(prop, typeof(MyAttribute)));
这样避免了必须实现任何属性实例(即,它比便宜
GetCustomAttribute[s]()。