如何在C#中获取列表中的数组项
IEnumerable<object> enumerable = c1._getbrandrequest(object[]);
List<object> brand = enumerable.Cast<object>().ToList();
List<Brand> brands = new List<Brand>();
for (int i = 0; i <= enumerable.Count(); i++)
{
var brnd = enumerable.ElementAt(i);
// brnd (intellisense only produce)
// brnd. { Equals, GetHashCode, GetType, ToString }
}
提前致谢!
object
列表,因此您必须将其转换为正确的类型,我猜测应该是object[]
。 - cbr