I'm having an object named data,which belongs to the class,
[DataContract]
public class names
{
[DataMember(Name = "code")]
public int Code { get; set; }
[DataMember(Name = "message")]
public string Message { get; set; }
[DataMember(Name = "values")]
public values values{ get; set; }
}
where values is another class with variables of its own, initially while executing the following code,
names data= new names();
data.values.Name = "";
I get a null exception when executing the second line.
What is the issue?Why data.values.Name is still null even after executing
names data= new names();
what should i do to give it some value?