0
が見つかりませ最適なタイプは私は次のように別々のという名前の配列を持っていない:暗黙的に型指定された配列のJSONエラー
var scheduleListAll = await DataService.GetSchedule(Id);
scheduleList = scheduleListAll.ScheduleItems;
そして、私のようなdoorsForSite
という名前の別の配列があります。
var doorsForSite = new[]
{
new { ControllerId ="controller1",ControllerName="C1",IsChecked = "false",
Doors = new[]
{
new { DoorId="Door1",DoorName="DoorOne"},
new { DoorId = "Door2", DoorName = "DoorTwo" }
},
scheduleList
},
new { ControllerId ="controller2",ControllerName="C2",IsChecked = "false",
Doors = new[]
{
new { DoorId= "Door3",DoorName="DoorThree"},
new { DoorId = "Door4", DoorName = "DoorFour" },
new { DoorId = "Door5", DoorName = "DoorFive" },
}
}
};
どのようにしsecond
にfirst array
を含めますか?
私が試した:
var doorsForSite = new[]
{
new { ControllerId ="controller1",ControllerName="Eagle",IsChecked = "false",new object[] { scheduleList },
Doors = new[]
{
new { DoorId="Door1",DoorName="DoorOne"},
new { DoorId = "Door2", DoorName = "DoorTwo" }
},
scheduleList
},
new { ControllerId ="controller2",ControllerName="NetAxis",IsChecked = "false",new object[] { scheduleList },
Doors = new[]
{
new { DoorId= "Door3",DoorName="DoorThree"},
new { DoorId = "Door4", DoorName = "DoorFour" },
new { DoorId = "Door5", DoorName = "DoorFive" },
}
}
};
をしかし、動作しませんでした。何をすべきか ?