title: (XAMARIN ANDROID) - How can I for each loop through a List<T> and grab each item then pass to a array adapter then to a listview
body: <p>Heres my sample code for getting the values from API :</p>
  
  <p>My Class Info (Models)</p>
  
  <pre><code> public class COUNTRESULT_Info
  {
  
  public  decimal STDSKU { get; set; }
  
  public  decimal STDQTC { get; set; }
  
  public  string CSTSDS { get; set; }
  
  public  string STDDSC { get; set; }
  
  
  }
  </code></pre>
  
  <p>My repository for API :</p>
  
  <pre><code> public async Task&lt;List&lt;T&gt;&gt; GetCountResult(string trfnumber, string usertype) {
  
          var httpClient = new HttpClient();
          var json = await httpClient.GetStringAsync("http://hoscbdd1:8888/api/result/GETCOUNTRESULT/"+trfnumber+"/"+usertype);
  
          return JsonConvert.DeserializeObject&lt;List&lt;T&gt;&gt;(json);
  
      }
  
  }
  </code></pre>
  
  <p>Activity FOR ANDROID (THROUGH LIST VIEW):</p>
  
  <pre><code>   private async void GetCountResult(string trfnumber, string usertype) {
  
          ResultRepository&lt;COUNTRESULT_Info&gt; repo = new ResultRepository&lt;COUNTRESULT_Info&gt;();
  
          var result = await repo.GetCountResult(trfnumber, usertype);
  
          if (result != null)
          {
              stringResult = result.Select(x =&gt; x.ToString()).ToList();
              adapter = new ArrayAdapter&lt;string&gt;(this, Android.Resource.Layout.SimpleListItem1, stringResult);
              listview_countresult.Adapter = adapter;
          }
      }
  </code></pre>
  
  <p>The output in my listview is it counts how many objects Found like:</p>
  
  <p>SCRS.MODEL.COUNTRESULT_Info</p>
  
  <p>SCRS.MODEL.COUNTRESULT_Info</p>
  
  <p>SCRS.MODEL.COUNTRESULT_Info</p>
  
  <p>SCRS.MODEL.COUNTRESULT_Info</p>
  
  <p>SCRS.MODEL.COUNTRESULT_Info</p>