c#中 IList的调用有关问题,求各位大牛解答,新手求教

c#中 IList的调用问题,求各位大牛解答,新手求教

public class CandidateItemOfRecognize
    {
        public double confidence { get; set; }
        public string person_id { get; set; }
        public string person_name { get; set; }
        public string tag { get; set; }
    }
    public class FaceItemOfRecognize
    {
        public Position position { get; set; }
        public string face_id { get; set; }
        public IList<CandidateItemOfRecognize> candidate { get; set; }
    }
    public class IdentifyResult
    {
        public string session_id { get; set; }
        public IList<FaceItemOfRecognize> face { get; set; }
    }






本人已经实例化IdentifyResult,名为ir_group,请问怎么调用CandidateItemOfRecognize里的confidence,关于IList的用法不是很熟悉。应该不是ir_group.face.candidate.confidence吧。。。
------解决思路----------------------
IdentifyResult.face[下标].candidate[下标].confidence
------解决思路----------------------
IdentifyResult result;
if(result.face !=null && result.face.Count>0)
{
   foreach(var f in result.face)
   {
          if(f!=null && f.candidate !=null && f.candidate.Count>0)
          {
                    foreach(var c in  f.candidate)
                   {
                           //c.confidence 
                   }
          }
   }
}