J'ai un objet (produit) avec une propriété de type 'array'
product.tags = {"tag1", "tag2", "tag9"}La propriété LINQ-array contient un élément d'un autre tableau
J'ai un tableau d'étiquettes d'entrée à filtrer.
... mais ce n'est pas tout à fait travail:
List<string> filterTags = new List<string>() { "tag1", "tag3" };
var matches = from p in products
where p.Tags.Contains(filterTags)
select p;
Toutes les recommandations? Merci.
Merci ... grand. Cela signifiait «tout» en réalité. .... "... afficher tous les produits contenant un ou plusieurs tags d'entrée". Je vais essayer. JE VOUS REMERCIE! – Rob
Comme LINQ pour toute personne intéressée: 'context.Products.Where (p => p.Tags.Any (tag => filterTags.Contains (tag)))' –