我运行查询时,我的WP8应用程序正在获取旧数据而不是更新数据:
private async Task fetchParseData()
{
try
{
var query = ParseObject.GetQuery("Favorite")
.WhereEqualTo("user", ParseUser.CurrentUser.Username);
IEnumerable<ParseObject> results = await query.FindAsync();
this.favorites.Clear();
foreach (ParseObject result in results)
{
string venue = result.Get<string>("venue");
string address = result.Get<string>("address");
string likes = result.Get<string>("likes");
string price = result.Get<string>("price");
string contact = result.Get<string>("contact");
this.favorites.Add(new ItemViewModel { LineOne = venue, LineTwo = address, LineThree = likes, Rating = "", Hours = "", Contact = contact, Price = price, Latitude = "", Longitude = "" });
}
if (favorites.Count == 0)
{
// emailPanorama.DefaultItem = emailPanorama.Items[1];
MessageBox.Show("You do not have any saved cafes. Long press a cafe in main menu to save it.");
}
}
catch (Exception exc)
{
MessageBox.Show("Data could not be fetched!", "Error", MessageBoxButton.OK);
}
}
您能否帮我找一下此查询中的问题所在。我调试并发现只有这一部分的错误。因此,我的新数据未被query.findasync()
方法提取。
答案 0 :(得分:0)
Windows Phone Web Cache非常具有侵略性。
如果您要查询的服务器未在http标头中明确设置缓存持续时间,则Windows Phone会缓存所有请求(虽然不知道持续时间,但很长)。
你可以:
有关详细信息,请参阅this question。