I cannot deserialize the following JSON to an ObservableCollection (required for WPF applications) but successfully deserialize it to a List. In such a case deserializing to an ObservableCollection should be possible as well?!
Exception:
{"The JSON value could not be converted to System.Collections.Generic.ICollection`1[WpfApp12.Testing+Foo]. Path: $.MyList | LineNumber: 1 | BytePositionInLine: 22."}
JSON:
{
"MyList": [
{
"Name": "Paul"
},
{
"Name": "Mike"
}
]
}
Fails:
public class Foo
{
public ObservableCollection<FooMember> MyList { get; set; }
}
public class FooMember
{
public string Name { get; set; }
}
Succeeds:
public class Foo
{
public List<FooMember> MyList { get; set; }
}
public class FooMember
{
public string Name { get; set; }
}
I cannot deserialize the following JSON to an ObservableCollection (required for WPF applications) but successfully deserialize it to a List. In such a case deserializing to an ObservableCollection should be possible as well?!
Exception:
{"The JSON value could not be converted to System.Collections.Generic.ICollection`1[WpfApp12.Testing+Foo]. Path: $.MyList | LineNumber: 1 | BytePositionInLine: 22."}JSON:
Fails:
Succeeds: