How Can I Use IEnumerator.Reset()?

never; ultimately this was a mistake. The correct way to iterate a sequence more than once is to call .GetEnumerator() again – i.e. use foreach again. If your data is non-repeatable (or expensive to repeat), buffer it via .ToList() or similar.

It is a formal requirement in the language spec that iterator blocks throw exceptions for this method. As such, you cannot rely on it working. Ever.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)