I have pasted JSON in to my C# console application, so it produces classes like so :
public class Rootobject
{
public Id id { get; set; }
}
public class Id
{
public Identifier Identifier { get; set; }
}
public class Identifier
{
public Id1 id { get; set; }
public Type type { get; set; }
}
public class Id1
{
public string IdentifierString { get; set; }
}
public class Type
{
public string IdentifierType { get; set; }
}
I wish to set the values of identifierString
and identifierType
like so :
var node = new Rootobject();
node.id.Identifier.id.IdentifierString = "testId";
node.id.Identifier.type.IdentifierType = "idType";
However, I get an 'Object reference not set to an instance of an object' error.