Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC#IEnumerable vs IQueryableSingle-choice MCQ

An interface exposes IEnumerable<int> Ids, but the concrete object is actually an IQueryable<int> backed by a database. A caller writes ids.Where(x => x > 10).Count(). What executes?

IEnumerable<int> ids = repo.GetIds(); // really an IQueryable<int> int n = ids.Where(x => x > 10).Count();