2012-05-01 11 views

答えて

1

あなたは私のためとして検索するための最良の方法は辞書で、著者のリストを持っている場合:

var auditors = list.ToDictionary<IdType, Author>(key => key.Id, value => value) 
Auditor auditor; 
if(auditors.ContainsKey(key)) 
{ 
    auditor = auditors[key]; 
} 

OR

Auditor auditor; 
if(auditors.TryGetValue(key, out auditor)) 
{ 
    ... 
} 
関連する問題