using System.Collections.Generic;
public static void Main()
var _commodityCode = "AP";
var ddlListFromDB = new List<DropDownItem>()
{Value = "AP", Text = "AP: SPI 200", Filter = "sfe"}, new DropDownItem()
{Value = "AT", Text = "AT: S&P/ASX 200 Gross TR Index", Filter = "sfe"}};
if (ddlListFromDB.Count == 0 || !ddlListFromDB.All(x => x.Value == _commodityCode))
Console.WriteLine("You are in error. NOT GOOD.. we do have AP in the list");
if (ddlListFromDB.Count == 0 || !ddlListFromDB.Any(x => x.Value == _commodityCode))
Console.WriteLine("You wont see this!");
Console.WriteLine("All good. We have AP in the list");
public class DropDownItem