C# Printing Properties
- by Mark
I have a class like this with a bunch of properties:
class ClassName
{
string Name {get; set;}
int Age {get; set;}
DateTime BirthDate {get; set;}
}
I would like to print the name of the property and it's value using the value's ToString() method and the Property's name like this:
ClassName cn = new ClassName() {Name = "Mark", Age…