使用 eBay API .NET SDK 分配给 findItemByCategoryRequest.outputSelector[] 时出现问题
我正在尝试使用如下代码分配一个值:
findItemByCategoryRequest r = new findItemByCategoryRequest()
r.outputSelector = outputSelectorType.SellerInfo
........etc
但是,当我尝试构建时出现错误:
"Cannot implicitly convert type 'FinalEbayParser.com.ebay.developer.OutputSelectorType'
to 'FinalEbayParser.com.ebay.developer.OutputSelectorType[]'"
现在我期望有一个对象,某种类型的outputSelectorTypes数组..但似乎没有存在于 .NET 的 Ebay Find API 中
有一个 itemFilters (itemFilter[]) ,您可以分配不同数量的项目过滤器,然后将 itemFilter[] 对象分配给属性 r.itemFilter
任何帮助都很多对此表示赞赏,这就是我需要完成的所有工作来签署一个已经过期的项目。 Ebay 网站本身提供的关于在 .NET 中使用 API 的信息非常少,我有一种感觉,这甚至可能是他们完全忘记的事情......显然这发生在过去。
I'm trying to assign a value with code like the following:
findItemByCategoryRequest r = new findItemByCategoryRequest()
r.outputSelector = outputSelectorType.SellerInfo
........etc
However I am getting an error when I try to build:
"Cannot implicitly convert type 'FinalEbayParser.com.ebay.developer.OutputSelectorType'
to 'FinalEbayParser.com.ebay.developer.OutputSelectorType[]'"
Now I would expect there to be an Object, some sort of array of outputSelectorTypes..but one doesn't seem to exist in the Ebay Finding API for .NET
There is such a thing for itemFilters (itemFilter[]) which you can assign a various number of item filters and then assign the itemFilter[] object to the property r.itemFilter
Any help is much appreciated with this, it is all I need working to sign off on a project that is already over due. The Ebay website itself gives very very little info about using the API with .NET and I have a feeling this may even be something they have forgotten completely somehow...Apparently that's happened in the past.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题是您试图将单个对象分配给一个属性,该属性是此类对象的数组。现在,我还没有使用过 eBay API,所以我不知道它到底是如何工作的,但你可以尝试分配一个数组:
如果你使用的 C# 版本不支持类型推断,你将需要显式地声明数组类型:
Your problem is that you are trying to assign a single object to a property that is an array of such objects. Now, I haven't used the eBay API, so I don't know exactly how it works, but you could try to assign an array instead:
If you are using a C# version that does not support type inference you will need to explicitly state the array type: