我正在尝试将字典(Of string,string)添加到Ienumerable(Of Dictionary(Of string,string))
看起来很简单,但我找不到答案......如果你需要更好的探索,这是我的代码
Dim actualList As IEnumerable(Of Dictionary(Of String, String))
Dim addRows As New Dictionary(Of String, String)
addRows.Add("LinkTitle", "Ultimate Test Item")
我想在这里,我会尝试将addrows添加到actualList中,但我这样做有困难....
'this sends our custom dictionary to sharepoint
Dim updateOutput = ListServiceUtility.UpdateListItems(Test_Sharepointsite_url, myCred, Test_List_Name, Nothing, addRows.AsEnumerable, 1)
答案 0 :(得分:4)
IEnumerable没有您要查找的.Add功能,请尝试使用List:
Dim actualList As New List(Of Dictionary(Of String, String))
Dim addRows As New Dictionary(Of String, String)
addRows.Add("LinkTitle", "Ultimate Test Item")
Dim addRows2 As New Dictionary(Of String, String)
addRows2.Add("LinkTitle2", "Ultimate Test Item2")
actualList.Add(addRows)
actualList.Add(addRows2)
进一步阅读:What's the difference between IEnumerable and Array, IList and List?