skydrive System.Dynamic.DynamicObject

前端 未结 2 975
予麋鹿
予麋鹿 2021-01-21 09:20

I\'m trying to get a listing of all the folders for a signed in user on SkyDrive.

LiveOperationResult operationResult = await client.GetAsync(\"me/skydrive/file         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-01-21 10:13

    The problem is that LiveOperationResult.Result isn't necessarily guaranteed to be a Dictionary. It is however defined as an IDictionary.

    Mind you, you don't appear to even need to cast the Result property to a dictionary of any sort; you should be able to use the dynamic variable to directly access the list you want to iterate.

    List folders = (List)result.data;
    
        

    提交回复
    热议问题