I have this matchd condition:
var matchConditions = new long[][]
{
new long[] { 109, 145 },
new long[] { 202 },
new long[] { 303, 309, 317, 318 },
};
each of them is the id of another group, for example, the first nested array for color.
and I need to know which products match the color ID 109 or 145, the second one for something else.
I want me to get all the products that match any element of each group,
{color 109 or 145 - and - area 202 - and - option 303 or 309 or 317 or 318}
I tried:
matchConditions.ToList().ForEach(x => x.Any(j => adAdFields.Select(co => co.listFieldId).Contains(j)))
and
matchConditions.All(x => x.Any(j => adAdFields.Select(co => co.listFieldId).Contains(j)))
but none of them work
EDIT: I
used to have this request:
var adsWithRelevantadFields =
from adField in cwContext.tblAdFields
join ads in cwContext.tblAds on adField.adId equals ads.id
where (prvId == 0 && ads.tabId == tabId) ||
(prvId != 0 & ctsId.Value == 0 && ads.provinceId == prvId & ads.tabId == tabId) ||
(prvId != 0 & ctsId.Value > 0 && ads.provinceId == prvId & ads.cityId == ctsId.Value & ads.tabId == tabId)
where ads.endDate >= theToDay
where ads.conditionId == 1
where ads.payed == true
group adField by adField.adId into adAdFields
where searchIds.All(i => adAdFields.Select(co => co.listFieldId).Contains(i))
, , , , "& &" , .
EDIT2
, (, , , ,....) , , (productId, attributeId), , , (1 109 - 1,202 - 1, 303...) (2,109 - 2,202-2,318...)...
( ), , grop:
{ 109 145 - - 202 - - 303 309 317 318}