名單的最大名單上有以下兩類:返回實體框架C#
public class Result
{
public string plate { get; set; }
public double confidence { get; set; }
public int matches_template { get; set; }
public int plate_index { get; set; }
public string region { get; set; }
public int region_confidence { get; set; }
public long processing_time_ms { get; set; }
public int requested_topn { get; set; }
public List<Coordinate> coordinates { get; set; }
public List<Candidate> candidates { get; set; }
}
public class Candidate
{
public string plate { get; set; }
public double confidence { get; set; }
public int matches_template { get; set; }
}
我有這個疑問:
List<List<Candidate>> lstCandidates =
deserializedProduct.results.Select(i=>i.candidates).ToList();
正如你可以看到我有list<Candidate>
列表。每個候選人都有plate
和confidence
。我需要最大的信心在我的lstCandidates
板數。如何獲得這個值?
你嘗試過什麼嗎?我會很樂意提供幫助,但是您必須展示您所嘗試的內容,以便我們幫助您糾正它。你是否正在尋找max'confidence'值,或者你在尋找具有最大'confidence'值的'Candidate'項目。 –
@GiladGreen你知道我想使用foreach解決方案,傳統的解決方案。但還沒有編碼。我想知道也許有更好的解決方案 –
@GiladGreen我需要最大信心的板數 –