0
我找不到優雅的Linq方法來檢索分配給人員列表中某人的最大日期,該人員被分配到任務中。從字典中的值列表中獲取最大日期
我的代碼是
public class Mission
{
public string MissonAssignedTo { get; set; }
public DateTime Date { get; set; }
}
public Dictionary<string, Dictionary<string, List<Mission>>> MissionList =
new Dictionary<string, Dictionary<string, List<Mission>>>();
我有這個詞典用這種價值觀
MissionList[0] Key = MissionImpossible
Value = count 1
Key=Sean
Value=count 7
[0] = date = 10/01/2017
[1] = date = 10/01/2016
[2] = date = 10/01/2017
[3] = date = 10/01/2018
[4] = date = 10/01/2015
[5] = date = 10/01/2014
[6] = date = 10/01/2013
MissionList[1] Key = MissionImpossibleThePayPack
Value = count 1
Key=Connery
Value=count 4
[0] = date = 10/01/2017
[1] = date = 10/01/2019
[2] = date = 10/01/2017
[3] = date = 10/01/2018
我需要檢索字典的每個人,他的最大日期,像這樣的。
dicoResult= {
{Sean,10/01/2018} ,
{Connery,10/01/2019}
}
此致敬禮。 Jolynice
你可以提供有效的C#代碼字典樣本嗎?並顯示你到目前爲止已經嘗試過 –