我试图将数组追加到匿名数组,但收到此错误:
No best type found for implicitly typed-array.
这是我要附加的数组:
var products = myProductList.Select(x => new
{
isAvailable = 0,
photo = x?.ImageUrl
}).ToArray();
Here is the part of the code where I'm trying to append it (my products array) to, so I want to append rest of the array data to productImages
anonymous array:
var articles_data = new
{
products = new[]
{
new
{
prodDate = product.GetDate();
prodtOrdNumb = product.OrdinalNumber,
productAmount = product.Amount
}),
productImages = new[] {
new
{
isAvailable = 1,
photo = productFile?.ImageUrl
},
products.ToArray() // HERE I TRIED TO APPEND MY ARRAY
}
}
}
};
正如您所看到的,我已经张贴了我尝试附加数组的地方,并收到了以下信息:
找不到隐式类型数组的最佳类型。
任何形式的帮助都将非常棒!
谢谢!