c# - Rewrite foreach statement to linq -
i still learning linq
bear me :). question, how convert following code linq
int count = 0; foreach (var item in settings.favouritessetting) { if (item.favouritetype != constants.favouritetype.folder) count++; } return count.tostring();
var count = settings.favouritessetting.count(i => i.favouritetype != constants.favouritetype.folder); return count.tostring();
Comments
Post a Comment