public static ProcessedUserFeed ProcessUsers(IEnumerable <User> preProcessUsers) { var processedUsers = preProcessUsers.Select((user) => { var processedUser = new ProcessedUser { City = user.City, Country = user.Country, DOB = user.DOB, Email = user.Email, FirstName = user.FirstName, Gender = user.Gender, LastName = user.LastName, Salutation = user.Salutation, State = user.State, UserId = user.UserId }; var customFields = new Dictionary <string, JToken>(); foreach (var customField in user.CustomFields) { var values = customField.Value.Select((value) => { return(WebUtility.HtmlEncode(value)); }); customFields.Add(WebUtility.HtmlEncode(customField.Key), new JArray(values)); } processedUser.CustomFields = customFields; return(processedUser); }); return(new ProcessedUserFeed { Users = processedUsers.ToArray() }); }
public static bool IsMainUser(this ProcessedUser props) { return !(props.Properties.userDetails?.upn?.Contains("#EXT#") ?? true); }