public void testquestions() { var creds = File.ReadAllLines(@"C:\tmp\sg_creds.txt"); var apiClient = new ApiClient() { ApiToken = creds[0], ApiTokenSecret = creds[1] }; Func<QuestionOptions[], string> joinOptions = (options) => options != null && options.Length > 0 ? "\noptions :\n" + string.Join(",\n\n", options.Select(o => o.title.English)) + ",\n" : ""; var questions = apiClient.GetQuestions(2687802).Where(q => q._type == "SurveyQuestion").ToList(); var gizmoQuestions = questions.Select(q => new { ID = q.id.ToString(), Question = q.title != null ? q.title.English + joinOptions(q.options) : "", QCode = q.properties != null && q.properties.question_description != null && q.properties.question_description.English != null ? HtmlRegex.Replace(q.properties.question_description.English, string.Empty) : "", AnswerFormat = q._subtype ?? "" }).ToList(); foreach (var gizmoQuestion in gizmoQuestions) { Trace.WriteLine(gizmoQuestion.QCode); } }