public CustomRider CreateRidePin() { var pin = new CustomRider() { Id = string.IsNullOrEmpty(Id) ? UserPrincipalName : Id, Title = GivenName, Description = GivenName }; if (HasLocation()) { pin.Longitude = Longitude.Value; pin.Latitude = Latitude.Value; } pin.Color = ProfileColor; if (!string.IsNullOrEmpty(DisplayName)) { var split = DisplayName.Split(' '); if (split.Any()) { pin.Acronym = string.Format("{0}{1}", split.First().Substring(0, 1), split.Last().Substring(0, 1)); } } else { pin.Acronym = string.Format("{0}{1}", UserPrincipalName.Substring(0, 1), UserPrincipalName.Substring(1, 2)); } return(pin); }