Problem with declaring a collection of objects : <p>When I run this code i get a Null Reference exception error when I try to add a tag to the tagCollection. I'm pretty it's an issue with how I've declared tagCollection but I'm not sure where I'm going wrong.</p>

<p>The 2 classes setup are to enable me serialize the collection back to a JSON file once I have finished collecting my data.</p>

<pre><code> class TagCollection
{
    [JsonProperty("tags")]
    public List&lt;Tag&gt; Tags { get; set; }
}

public class Tag
{
    [JsonProperty("name")]
    public string Name { get; set; }

    [JsonProperty("id")]
    public string Id { get; set; }

    [JsonProperty("value")]
    public string Value { get; set; }
}

private TagCollection tagCollection;  

private void createCollection(){

    tagCollection.Tags.Add(
        new Tag { Name = "Test", Id = "tag1", Value = "145" }
    );

}
</code></pre>
