i have this class:
class Ean
{
public string Code{ get; set; }
}
class Article
{
public int Id { get; set; }
public string Name { get; set; }
public List<Ean> BarCode { get; set; }
}
List<Article> arts = new List<Article>();
List<Ean> eans = new List<Ean>();
I have a list of two objects. I need to check if in the list "arts.BarCode" there is one of the codes in the list eans. How can I do to make this search returns a Boolean value? Any help would be great! Thanks!
something like this would be perfect:
bool hasCheese = arts.Any(a => a.Name == "Cheese");