【发布时间】:2016-01-28 19:30:01
【问题描述】:
考虑以下接口
public interface ISample
public interface ISample2 : ISample
public class A
{
[Field]
ISample SomeField {get; set;}
[Field]
ISample2 SomeOtherField {get; set; }
}
假设有各种类,如 A 类和各种字段,如 SomeField 和 SomeOtherField。 如何获取所有此类字段的列表,这些字段属于 ISample 类型或从 ISample 派生的其他接口(如 ISample2)
【问题讨论】:
-
这些都不是字段。这些都是属性。
标签: c# .net reflection interface