using System.Collections.Generic;
public static void Main()
var results = new List<UserApplications>()
{AppFormName = "TFB Test Application", QuestionName = "How old are you?", QuestionType = 1}, new UserApplications()
{AppFormName = "TFB Test Application", QuestionName = "Where are you from?", QuestionType = 1}, new UserApplications()
{AppFormName = "HLL", QuestionName = "How old are you?", QuestionType = 1}, new UserApplications()
{AppFormName = "HLL", QuestionName = "Where are you from?", QuestionType = 1}, new UserApplications()
{AppFormName = "HLL", QuestionName = "What Game are you applying for?", QuestionType = 2}, new UserApplications()
{AppFormName = "HLL", QuestionName = "Do you agree to the clan rules", QuestionType = 3}};
var appFormList = results.GroupBy(s => s.AppFormName).Select(g => new
AppFormName = g.Key, Questions = g.Select(a => new
a.QuestionName, a.QuestionType
Console.WriteLine(JsonConvert.SerializeObject(appFormList));
public class UserApplications
public string AppFormName
public string QuestionName