public List<carlistviewmodel> GetFilter(List<string> HondaCustomer, List<carlistviewmodel> CarList) { List<carlistviewmodel> List = new List<carlistviewmodel>(); foreach (string Hcustomer in HondaCustomer) { foreach (CarListViewModel detail in CarList) { if (detail.CustomerName == Hcustomer) { List.Add(detail); } } } return List; }
List<carlistviewmodel> List = CarList.Where(detail => HondaCustomer.Contains(detail.CustomerName)).toList();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)