I\'ve recently used LINQ
In the following code:
ArrayList list = new ArrayList();
var myStrings = list.AsQueryable().Cast();
You do not need the call to AsQueryable()
. Queryables only make sense when a LINQ query (expressed in C#) needs to be converted to another domain language (such as SQL). In your case since you are working with LINQ to Objects (you are operating on an array list) this is not needed.
You can call the Cast
method directly on the list instance. Another choice would be to start with a strongly-typed collection such as List
.