有没有办法在 C# 中有效地做到这一点?
鉴于:
List<Thing> listOfThings = new List<Thing>() {};
期望的输出:
String[] thingNames = (Gather up all the (string)Thing.Name values into an array)
Int[] thingID = (Gather up all the (int)Thing.ID values into an array)
我知道有一个listOfThings.ToArray()但我需要的是类似listOfThings.Name.ToArray()和listOfThings.ID.ToArray()的东西。
最后,我希望将这些数组用于 Oracle 数组绑定。
谢谢,
~ 肖恩