I have some code which creates many dictionaries to creates JSON data and then send it as API request. The first time this works, this is the dictionary:
var values = new Dictionary<string, string>
{
{ "TestrunId", testrunId },
{ "Sequence", "1" },
{ "Type", "RequirementSet" },
};
new QualityMonitorApi().SendRequest(values);
Then the second time I do this:
var values = new Dictionary<string, string>
{
{ "TestrunId", testrunId },
{ "Sequence", "1" },
{ "Type", "Requirement" },
{ "Name", jsonRequirementItem.Name },
{ "UniqueId", requirement.UniqueId },
};
new QualityMonitorApi().SendRequest(values);
But then I get a System.NullReferenceException was unhandled
error with the info: The object reference is not set to an instance of an object
. So what am I doing wrong here?