I have an ArrayList that imports records from a database. Is there a way to check if the List schname array that I want to map to another list, which is an api, contains?
List<PrimaryClass> primaryList = new List<PrimaryClass>(e.Result); PrimaryClass sc = new PrimaryClass(); foreach (string item in str) { for (int a = 0; a <= e.Result.Count - 1; a++) { string schname = e.Result.ElementAt(a).PrimarySchool; string tophonour = e.Result.ElementAt(a).TopHonour; string cca = e.Result.ElementAt(a).Cca; string topstudent = e.Result.ElementAt(a).TopStudent; string topaggregate = e.Result.ElementAt(a).TopAggregate; string topimage = e.Result.ElementAt(a).TopImage; if (item.Contains(schname)) { } } }
Here is what I have come up with so far, kindly correct any mistakes that I could make. Thanks.
source share