LINQ Statement for Generic List -
i have bool array , list:
bool[ ] searchable list<t> alldata
what want following
alldata.where(c => searchable[0] && c[0].contains("das") || searchable[1] && c[1].contains("das") || searchable[2] && c[2].contains("das") ... );
how can construct linq function?
use this overload of where
provides filtering callback index of element being considered along element itself:
var results = alldata.where((c, i) => searchable[i] && c.contains("das"));
Comments
Post a Comment