我得到此錯誤@列表)itemPage.userId無法投射類型爲'Linq.LookupList`1 [System.Nullable`1 [System.Int32]]'的對象以鍵入Generic.List`1 [System.Nullable`1 [System.Int32]]'
無法轉換類型的對象 'Microsoft.SharePoint.Linq.LookupList 1[System.Nullable
1 [System.Int32]]' 爲類型「System.Collections.Generic.List 1[System.Nullable
1 [系統。 INT32]」
代碼:
List<MySitePage> userId = PagesFacade.GetPages(web.Url, (List<int?>)itemPage.userId);
其中userid在ItemPage是私人Microsoft.SharePoint.Linq.LookupList<System.Nullable<int>> _userId ;
public static List<MySitePage> GetPages(string relativeWebUrl, List<int?> userIds)
謝謝SPFiredrake IList爲我工作。 –