foreach(var i in this.SomeDict<string, object>.Keys.TakeWhile(x => x.Conains("somestring")))
{
//do work.
}
i know for a fact that there are string containing "somestring". During debugging the debugger just stepps into the TakeWhile, returns twice to dict, goes into in once and then just skips the inner block. The I variable is being resolved to a string, and the result of the takewhile is a ienumerable, so why does it skip iterating over the returned elements?