You can use the OfType
Linq method for that:
var ofTypeA = collection.OfType<A>();
Regarding your unwillingness to loop throught the collection, you should keep in mind that Linq does not do magic tricks; I didn’t check the implementation of OfType
, but I would be surprised not to find a loop or iterator in there.