W
wdudek
I have a list (actually an IList) of objects that implement an interface and
need to cast the list to a list of the intercace. Is there an easy and
"clean" way to do this, I tried using a direct cast (List<IMyInterface>)
myObjectList, but it threw an exception at run time. In the past I have done
this with a foreach loop, but it seems like there would be some extension
method to do it for me. Also I'm on the 3.5 framework.
Thanks
Bill
need to cast the list to a list of the intercace. Is there an easy and
"clean" way to do this, I tried using a direct cast (List<IMyInterface>)
myObjectList, but it threw an exception at run time. In the past I have done
this with a foreach loop, but it seems like there would be some extension
method to do it for me. Also I'm on the 3.5 framework.
Thanks
Bill