int[] intArray = { 1, 2, 3, 4, 5 };
SimpleStructure[] sstructArray =
{ new SimpleStructure(1, "One"), new SimpleStructure(2, "Two") };
// For value types, cast through IEnumerable<object>.ToArray()
AcceptsAnArray(intArray.Cast<object>().ToArray());
AcceptsAnArray(sstructArray.Cast<object>().ToArray());
沒有留言:
張貼留言