How can I convert IEnumerable<object>
to List<IFoo>
where each object is an IFoo
?
I have an IEnumerable<object>
, someCollection
, and each item in someCollection
is an IFoo
instance. How can I convert someCollection
into a List<IFoo>
? Can I use convert or cast or something instead of looping through and building up a list?