using System.Collections.Generic;
public static void Main()
var contact = new SyncContact { FirstName="Test", LastName="Person", Phone="123-123-1234", Email="test@test.com"};
var t = typeof(SyncContact);
var props = t.GetProperties().Select(p => new { p, attr = p.GetCustomAttribute<SyncProperty>() }).Where(p => p.attr != null);
var dict = props.ToDictionary(p => p.attr.PropertyName, v => v.p.GetValue(contact) );
public class SyncProperty : Attribute
public readonly string PropertyName;
public SyncProperty(string propertyName)
this.PropertyName = propertyName;
[SyncProperty("first_name")]
public string FirstName { get; set; }
[SyncProperty("last_name")]
public string LastName { get; set; }
public string Phone { get; set; }
public string Email { get; set; }