private void EnsureIsMaterialized()
{
ThrowIfDisposed();
if (!_isMaterialized)
{
var elements = Materialize();
try
{
_isMaterialized = true;
base.AddRange(elements);
MaterializeCompleted();
}
catch
{
base.Clear();
_isMaterialized = false;
throw;
}
}
}
}