0
私はJSONファイルを持っています。ファイル内のエントリが順不同である可能性があります。JSONファイルから最後の "日付"を取得するにはどうすればよいですか?
最後のカレンダーの日付入力はどのようにして取得できますか?
JSONファイルには、日付のパターンのみが、それは常に月曜日になるということですLINQ を使用して見つけるの簡単な方法がある場合は私に知らせてください
[
{
"name": "Vacant",
"date": "02/6/2017",
"title": "Division Manager",
"mondayAM": "Main Campus AM",
"mondayPM": "Main Campus PM",
"tuesdayAM": "Main Campus AM",
"tuesdayPM": "Main Campus PM",
"wednesdayAM": "Main Campus AM",
"wednesdayPM": "Main Campus PM",
"thursdayAM": "Main Campus AM",
"thursdayPM": "Main Campus PM",
"fridayAM": "Main Campus AM",
"fridayPM": "Main Campus PM",
"saturdayAM": "Main Campus AM",
"saturdayPM": "Main Campus PM"
},
{
"name": "Vacant",
"date": "02/13/2017",
"title": "Division Manager",
"mondayAM": "Main Campus AM",
"mondayPM": "Main Campus PM",
"tuesdayAM": "Main Campus AM",
"tuesdayPM": "Main Campus PM",
"wednesdayAM": "Main Campus AM",
"wednesdayPM": "Main Campus PM",
"thursdayAM": "Main Campus AM",
"thursdayPM": "Main Campus PM",
"fridayAM": "Main Campus AM",
"fridayPM": "Main Campus PM",
"saturdayAM": "Main Campus AM",
"saturdayPM": "Main Campus PM"
},
{
"name": "Vacant",
"date": "02/20/2017",
"title": "Division Manager",
"mondayAM": "Main Campus AM",
"mondayPM": "Main Campus PM",
"tuesdayAM": "Main Campus AM",
"tuesdayPM": "Main Campus PM",
"wednesdayAM": "Main Campus AM",
"wednesdayPM": "Main Campus PM",
"thursdayAM": "Main Campus AM",
"thursdayPM": "Main Campus PM",
"fridayAM": "Main Campus AM",
"fridayPM": "Main Campus PM",
"saturdayAM": "Main Campus AM",
"saturdayPM": "Main Campus PM"
},
{
"name": "Vacant",
"date": "02/20/2018",
"title": "IT Division Manager",
"mondayAM": "Main Campus AM",
"mondayPM": "Main Campus PM",
"tuesdayAM": "Main Campus AM",
"tuesdayPM": "Main Campus PM",
"wednesdayAM": "Main Campus AM",
"wednesdayPM": "Main Campus PM",
"thursdayAM": "Main Campus AM",
"thursdayPM": "Main Campus PM",
"fridayAM": "Main Campus AM",
"fridayPM": "Main Campus PM",
"saturdayAM": "Main Campus AM",
"saturdayPM": "Main Campus PM"
}
]
のように見えます。
私CalendarModel.csは、多くの情報が含まれていません(現在は)
class CalendarModel
{
[JsonProperty("name")]
public string name { get; set; }
[JsonProperty("date")]
public string date { get; set; }
[JsonProperty("title")]
public string title { get; set; }
[JsonProperty("mondayAM")]
public string mondayAM { get; set; }
[JsonProperty("mondayPM")]
public string mondayPM { get; set; }
[JsonProperty("tuesdayAM")]
public string tuesdayAM { get; set; }
[JsonProperty("tuesdayPM")]
public string tuesdayPM { get; set; }
[JsonProperty("wednesdayAM")]
public string wednesdayAM { get; set; }
[JsonProperty("wednesdayPM")]
public string wednesdayPM { get; set; }
[JsonProperty("thursdayAM")]
public string thursdayAM { get; set; }
[JsonProperty("thursdayPM")]
public string thursdayPM { get; set; }
[JsonProperty("fridayAM")]
public string fridayAM { get; set; }
[JsonProperty("fridayPM")]
public string fridayPM { get; set; }
[JsonProperty("saturdayAM")]
public string saturdayAM { get; set; }
[JsonProperty("saturdayPM")]
public string saturdayPM { get; set; }
}
あなたの質問は不明です。これはJSONのすべてですか?私は1つの日付しか見ることができません。 – Equalsk
あなたの質問を指定してください。使用しているコードや、あなたが持っているライブラリやjsonパーサーは何もわかりません。あなたはC#などのモデルを持っていますか? –
他の2オブジェクトを追加しませんでしたが、日付が変更され、午前/午後のアイテムが繰り返されます。 –