Why is 1 different from 2 ?
public void Function(int newCount)
{
IEnumerable<Note> temp = notes.Take(newCount).ToArray();
notes.Clear();
notes.AddRange(temp);
}
public void Function(int newCount)
{
IEnumerable<Note> temp = notes.Take(newCount);
notes.Clear();
notes.AddRange(temp);
}
I know that 1 is ICollection 2 is just IEnumerable, but why doesn’t 2 work?