【发布时间】:2012-07-22 21:16:09
【问题描述】:
我可以在创建对象之前计算类中的属性数量吗?可以在构造函数中做吗?
class MyClass
{
public string A { get; set; }
public string B { get; set; }
public string C { get; set; }
public MyClass()
{
int count = //somehow count properties? => 3
}
}
谢谢
【问题讨论】:
标签: c# .net properties constructor