Check out example codes for "filter collection viewbag". It will help you in understanding the concepts better.

Code Example 1

((IEnumerable<ComboItem>)ViewBag.Districts).Where(x => x.ID == item.DISTRICT_ID);

Learn ReactJs, React Native from akashmittal.com