These are my types:
[<DataContract>]
type AreaCodeSingleResponse =
{ [<field:DataMember(Name = "id")>]
Id : string
[<field:DataMember(Name = "code")>]
Code : string
[<field:DataMember(Name = "name")>]
Name : string }
[<DataContract>]
type AreaCodeListResponse =
{
[<field:DataMember(Name = "areacode_list")>]
AreaCodeList : List<AreaCodeSingleResponse> }
This is a sample of the data:
{
"areacode_list": [
{
"id": "00447",
"code": "07",
"name": "UK Mobile",
"order_column": "_00447"
},
{
"id": "0044113",
"code": "0113",
"name": "Leeds",
"order_column": "0044113"
}
]
}
This is the deserialization code, where It's called passing in the type AreaCodeListResponse:
member __.ReturnDataToType<'T>() =
__.ReturnData
|> JsonConvert.DeserializeObject<'T>
Before I upgraded to DotNet6 this worked fine and returned a list of data. Afterwards, it fails and returns an empty list. There are no errors thrown but the list is empty.
This is failing for all my other calls to deserialize using the class and other types.
Has anything changed that I need to be aware of? I'm not a F# expert, just picking it up working on some legacy code.