[DataContract]
public class PersonField
{
private string _fieldName;
private object _fieldValue;
public PersonField()
{
}
public PersonField(string FieldName, object FieldValue)
{
_fieldName = FieldName;
_fieldValue = FieldValue;
}
[DataMember]
public string FieldName
{
get { return _fieldName; }
set { _fieldName = value; }
}
[DataMember]
public object FieldValue
{
get { return _fieldValue; }
set { _fieldValue = value; }
}
}
I have this class above which is used in my WCF service. when i try to create array on client side for this like
PersonField[] test = new PersonField[2];
test[0].FieldName = "test";
i get Object reference not set to an instance of an object. not sure what am i doing wrong?