public static void Main()
var fordFocus = new Car { Name = "Focus", Make = "Ford", KmPerLitre = 20 };
PrintProperties(fordFocus);
foreach (var property in typeof(Car).GetProperties())
property.SetValue(copy, property.GetValue(fordFocus));
private static void PrintProperties<T>(T input)
foreach (var property in typeof(T).GetProperties())
Console.WriteLine("{0}={1}", property.Name, property.GetValue(input));
public string Name { get; set; }
public string Make { get; set; }
public int KmPerLitre { get; set; }