0
我提出了一個新的查詢來從文章類中選擇每個項目的where子句。但是,儘管有選擇的字段,但它每次都會收到整個列表! 這裏是我的代碼:ParseQuery沒有考慮Where子句WindowsPhone
ParseQuery<Article> query = new ParseQuery<Article>();
if (souCategorie.SelectedIndex >= 0)
{
query.WhereEqualTo("idSCategorie", listeSouCategorie.ElementAt(souCategorie.SelectedIndex));
}
if(motcle.Text.Length > 0)
{
query.WhereContains("nom", motcle.Text);
// query.WhereContains("description", motcle.Text);
}
if(distance.Text.Length>0)
if (Convert.ToDouble(distance.Text) > 0)
{
Debug.WriteLine(distance.Text);
ParseGeoPoint geo = new ParseGeoPoint();
geo.Latitude = geoposition.Coordinate.Latitude;
geo.Longitude = geoposition.Coordinate.Longitude;
query.WhereWithinDistance("coordonnees", geo, ParseGeoDistance.FromKilometers(Convert.ToDouble(distance.Text)));
}
IEnumerable<Article> lst = await query.FindAsync();
rechercheResult.DataContext = lst.ToList();
怎麼可能是錯的?
即使我沒有選擇地理點,查詢也會繼續選擇所有數據。並只需設置「標稱」字段。 –
在這些if語句中添加斷點。那麼我敢打賭,他們沒有一個在擊中。 –
我試過了,它正在讓他們。我甚至用簡單的地方代替了整個代碼,它仍然獲得了整個數據。-_- –