using System; using System.Collections.Generic; using System.Linq; using System.Web; using EHEC_Server; using System.Web.Script.Serialization; namespace EHEC_Server { public class ClusterConverter { protected string Json { get; set; } public string WriteJson() { var Json = JsonConverter.Serialize(GetCluster()); //ClusterPatient p = new ClusterPatient(); //List clusterPatientsList = new List(); //clusterPatientsList = p.GetClusterPatients(); //ClusterResult r = new ClusterResult(); //List clusterResultsList = new List(); //clusterResultsList = r.GetClusterResults(); System.IO.File.WriteAllText(@"C: \Users\novski\Desktop\cluster.json", Json); return Json; //= JsonConverter.Serialize(clusterPatientsList); } private Cluster GetCluster() { return new Cluster { Comment = "some comment", Nodes = new List { new Node { Node get = new Node(); List xs = new List(); } Nodes.add(getClusterPatients()) // irrgend sowas... } }; } } }