skydrive System.Dynamic.DynamicObject
Estou tentando obter uma listagem de todas as pastas de um usuário conectado no SkyDrive.
LiveOperationResult operationResult = await client.GetAsync("me/skydrive/files");
dynamic result = operationResult.Result;
Eu gostaria de poder fazer algo assim:
Dictionary<string, object> folderData = (Dictionary<string, object>)result;
List<object> folders = (List<object>)folderData["data"];
foreach (object item in folders)
{
Dictionary<string, object> folder = (Dictionary<string, object>)item;
if (folder["name"].ToString() == "Folder Name")
{
showToastMessage(folder["id"].ToString());
return;
}
}
No entanto, nesta linha:
Dictionary<string, object> folderData = (Dictionary<string, object>)result;
Estou recebendo um erro:
Não é possível converter o tipo 'System.Dynamic.DynamicObject' para 'System.Collections.Generic.Dictionary'
Alguém tem alguma idéia de como eu posso contornar esse problema?