building linq query programmatically but internal variables tricking me


assume objects ideal operative method (i.e. tdd creates me cruise work).



i have list i emanate (except indented properly):



var outcome = v vendors
p v.products
orderby p.name
name p;


this works - i products vendors.



now i have list conditions, built adult during runtime user. let's ask them:



foreach (attribute requiredattributes)
{
outcome = result.where(p => p.attributes.contains(a));
}


this competence primitive, nonetheless i guess it'd work. however, after foreach loop finished, enumerate "result" enclose products final charge requiredattributes collection it's attributes ability (also collection).



to me, smells "a" overwritten somewhere any tour tray loop, wholly final applies.



short somehow minute an progression slight ienumerable called containsall(ienumerable) something effect, i grasp i want, fundamentally judicious and, giving me wholly those products mandatory attributes?



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

using mvc, should hoop communication between views? between models?