It is possible to use reflection, as shown by BigYellowCactus. But there is no need to do this in the constructor every time, because the number of properties never changes.
I would suggest doing this in a static constructor (called only once for each type):
class MyClass { public string A{ get; set; } public string B{ get; set; } public string C{ get; set; } private static readonly int _propertyCount; static MyClass() { _propertyCount = typeof(MyClass).GetProperties().Count(); } }
source share