Question: I have two types of classes:

```
public class HolidayClass
{
    public int ID { get; set; }
    public string Name { get; set; }
    public DateTime StartDate { get; set; }
    public DateTime EndDate { get; set; }
    public bool Active { get; set; }

    public HolidayClass(int ID, string Name, DateTime StartDate, DateTime EndDate, bool Active)
    {
        this.ID = ID;
        this.Name = Name;
        this.StartDate = StartDate;
        this.EndDate = EndDate;
        this.Active = Active;
    }

    public HolidayClass()
    {
    }
}

public class ProjectClass
{
    public int ID { get; set; }
    public string NetsisID { get; set; }
    public string Name { get; set; }
    public string Address { get; set; }
    public bool Active { get; set; }

    public ProjectClass(int ID, string NetsisID, string Name, string Address, bool Active)
    {
        this.ID = ID;
        this.NetsisID = NetsisID;
        this.Name = Name;
        this.Address = Address;
        this.Active = Active;
    }
    public ProjectClass()
    {
    }
}

```

and then I have two list items.

```
List<ProjectClass> pc;
List<HolidayClass> hc;

```

I can serialize a single list with:

```
myJson = new JavaScriptSerializer().Serialize(pc).ToString();

```

or

```
myJson = new JavaScriptSerializer().Serialize(hc).ToString();

```

I want to serialize these two lists in a single json string.
How can ı do this?

Answer: 
Most sensible thing to do is to create a new type for serialization or using an anonymous type:

```
var objects = new { HolidayClasses = hc, ProjectClasses = pc };
string result = new JavaScriptSerializer().Serialize(objects);

```
You will have to either create a class that contains both lists and then instantiate the class and serialize it. Or you can add the two lists to a dictionary and serialize it like this:

```
Dictionary<string, List<object>> sample = new Dictionary<string, List<object>>() { { "pc", pc }, { "hc", hc } };
myJson = new JavaScriptSerializer().Serialize(sample).ToString();

```