I have a list with several objects with different IDs.
In order to know the ID of an object I have to call a COM method:
fooList[i].GetID()
In the Immediate window I can write:
? fooList[0].GetID()
And it works perfectly.
However, I would like to iterate on the list and get all the IDs. I tried:
? fooList.Select(f => f.GetID())
But apparently it isn't supported
Error: Evaluation of method System.Linq.SystemCore_EnumerableDebugView`1[System.String].get_Items() calls COM method IFoo.GetID(). Evaluation of methods on COM objects is not supported in this context.
Is there a way I can get the IDs of all objects with a single loop?