Imagine I have a SearchService layer that has a method to search all cars starting with a certain string;
public static class Searcher{
public IAnInterface&l
Always go with IEnumerable
unless you have a serious reason not to. You can then implement the getter with yield return
.
IQueryable
is a totally different kettle of fish. Not something you'd casually implement as an alternative to a typical in-memory container.
Of the rest, there is a major different between IEnumerable
and the others: it's readonly.