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

Unlike IEnumerable<out T>, the IQueryable<T> interface is invariant in T. Why does the framework declare it that way?

IQueryable<string> strings = GetStrings(); IQueryable<object> objects = strings; // does not compile