我正在使用JsonDiffPatch和C#来比较以下两个json。我无法弄清楚如何在比较时忽略数组内的排序。两个json如下:传输地址内的传输类型是两个json中的不同顺序(第一个有电子邮件和电话,第二个有电话和电子邮件。
first Json File
"TestContacts": [
{
"$values": [
{
"Contact": {
"Addresses": {
"$values": [
{
"Contact": {},
"TransmissionAddresses": {
"$values": [
{
"FirstLine": "test.test1@test.com.au",
"TransmissionType": "EMAIL",
"AI": {
"CNM": "SYSTEM",
},
"V": 0
},
{
"FirstLine": "+11 0 1234 5678",
"TransmissionType": "TELEPHONE",
"AI": {
"CNM": "SYSTEM",
},
"V": 0
}
]
},
第二个json文件
{
"Contact": {
"Addresses": {
"$values": [
{
"Contact": {},
"TransmissionAddresses": {
"$values": [
{
"FirstLine": "+11 0 1234 5678",
"TransmissionType": "TELEPHONE",
"AI": {
"CNM": "SYSTEM",
},
"V": 0
},
{
"FirstLine": "test.test1@test.com.au",
"TransmissionType": "EMAIL",
"AI": {
"CNM": "SYSTEM",
},
"V": 0
}
]
},