public sealed class KnowledgeBase
{
public KnowledgeBase(string json)
{
KnowledgeBaseItemId = "109";
Description = "description";
Filename = "abc.txt";
TagInfo.Add("tagid","tagname");
}
public string KnowledgeBaseItemId { get; set; }
public string Description { get; set; }
public string Filename { get; set; }
public string FCKText { get; set; }
public string DateCreated { get; set; }
public IDictionary<string,string> TagInfo { get; set; }
}
This is my code snippet. It sets and get values for KnowledgeBaseItemId, Description, Filename, and so on.
But it throws an exception, when I try to add/set values to IDictionary in this line
TagInfo.Add("tagid","tagname");.
Exception is:
Object reference not set to an instance of an object.
Please help me what I'm doing wrong. Thanks in Advance!