using System.Collections;
using System.Collections.Generic;
public static void Main()
var evilList = new EvilList<int>(new[] { 1, 2, 3, 4, 5});
Console.WriteLine(evilList.First());
Console.WriteLine(evilList.Where(i => true).First());
foreach(var item in evilList)
public class EvilList<T> : IList<T>
private readonly List<T> Items;
public int Count => Items.Count;
public T this[int index] { get => Items[index]; set => Items[index] = value; }
public EvilList(IEnumerable<T> items)
this.Items = new List<T>(items);
public IEnumerator<T> GetEnumerator()
for (int i = Items.Count - 1; i >= 0; i--)
IEnumerator IEnumerable.GetEnumerator()
public bool IsReadOnly => throw new NotImplementedException();
public int IndexOf(T item)
throw new NotImplementedException();
public void Insert(int index, T item)
throw new NotImplementedException();
public void RemoveAt(int index)
throw new NotImplementedException();
throw new NotImplementedException();
throw new NotImplementedException();
public bool Contains(T item)
throw new NotImplementedException();
public void CopyTo(T[] array, int arrayIndex)
throw new NotImplementedException();
public bool Remove(T item)
throw new NotImplementedException();