I’ve recently used LINQ
In the following code:
ArrayList list = new ArrayList();
var myStrings = list.AsQueryable().Cast<string>();
What is the AsQueryable for? I know Cast creates a type-safe collection, and ArrayList is deprecated.
I’ve got a friend who says he needs the AsQueryable combined with ArrayList. I’m trying to understand why, but I can’t see why AsQueryable is needed.
Is he wrong?
AsQueryable would be used to produce an IQueryable which can then, if implemented, analyse the query via expression trees to rewrite it or translate it into some other language-like with linq to sql for example.
In this case it is completely pointless and you can tell your friend not to bother.