如何使用Parse Linq查询检索图像..?

时间:2014-03-02 12:13:02

标签: c# windows-phone-8 parse-platform

我想使用linq查询

从解析对象中检索图像
// Upload Photo to Parse
private async void UploadPhotoBtn_Click(object sender, RoutedEventArgs e)
{
    ParseFile img = new ParseFile("picture.png", UserPhoto);
    var photo = new ParseObject("photo");
    photo["Photo"] = img;
    await photo.SaveAsync();
}

// Query to retrieve 
private async void return_photo_Click(object sender, RoutedEventArgs e)
{
    var query = from photo in ParseObject.GetQuery("photo")
                orderby photo.CreatedAt descending
                select photo;
    IEnumerable<ParseObject> results = await query.FindAsync();
    foreach (var photo in results)
    {
    }
}

1 个答案:

答案 0 :(得分:0)

无论如何我都没有使用parse.com .NET API的经验。所以,在查看有关API的一些在线资源后,我得到的一个想法是,您是否试图以这种方式从查询中获取图像? :

foreach (var photo in results)
{
    ParseFile img = photo.Get<ParseFile>("Photo");
    //then try to use img.Url to display the image
}