Skip to content
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (13 sloc) 429 Bytes
using System.Collections.Generic;
using System.Linq;
namespace DangerousAssumptions.SlowPerformance
{
public interface IReader<T>
{
IReadOnlyCollection<T> GetItems();
// Default implementation like this makes assumptions
// about the underlying implementation.
// It also requires that *all* items are generated.
T GetItemAt(int index) => GetItems().ElementAt(index);
}
}
You can’t perform that action at this time.