public static void Main() {
var client = new Client();
client.FirstName = "James";
client.Birthdate = new DateTime(1953, 1, 4);
client.Email = "James@example.com";
client.Other = "Something";
var propertyValuesByName = client.GetType().GetProperties()
.Where(pi => pi.PropertyType == typeof(string))
.Select(pi => new { Val = (string) pi.GetValue(client), Name = pi.Name })
.Where(pi => !string.IsNullOrEmpty(pi.Val))
.ToDictionary(pi => pi.Name, pi => pi.Val);
foreach(var prop in propertyValuesByName) {
Console.WriteLine(prop.Key + ":\t " + prop.Value);
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime Birthdate { get; set; }
public string Email { get; set ;}