public static string DisplayName(this ProfileBase profile) { try { return(profile.GetPropertyValue("DisplayName").ToString()); } catch (Exception) { return(profile.FirstName() + " " + profile.LastName()); } }