You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ExcelSheet sheet = importer.ReadSheet();
var items = sheet.ReadRows<MyItem>();
if (!items.Any())
{
//Handle empty set
}
var list = items.ToList(); // This is now missing the first item from the sheet.
Following the standards for IEnumerable in C#, .Any() is not supposed to modify the IEnumerable in any way, including changing the pointer location in the collection, so you should still be able to retrieve the entire list.
It looks like .ToList() also has the same problem, so if you do .ToList() followed by .Any(), it now returns false instead of true. ToList is also not supposed to modify the IEnumerable.
The text was updated successfully, but these errors were encountered:
Following the standards for IEnumerable in C#, .Any() is not supposed to modify the IEnumerable in any way, including changing the pointer location in the collection, so you should still be able to retrieve the entire list.
It looks like .ToList() also has the same problem, so if you do .ToList() followed by .Any(), it now returns false instead of true. ToList is also not supposed to modify the IEnumerable.
The text was updated successfully, but these errors were encountered: