简体   繁体   English

移动服务蔚蓝-不指定列值

[英]Mobile services azure-not specifying an column value

var items = await App.MobileService.GetTable<Profile>().Where(item => (item.status == status) && 
(item.genre == genre)&&(item.category == category) && (item.location == location) &&
(item.age == age)).ToListAsync();

This is my query that I am sending to my azure database to retrieve the results. 这是我要发送到Azure数据库以检索结果的查询。 Assume the user doesn't specify a location however he satisfies all other requirements. 假定用户未指定位置,但他满足所有其他要求。 How can I retrieve all the results that are relevant to my query without specifying the location of that specific user and still be able to fetch it. 如何在不指定特定用户位置的情况下检索与查询相关的所有结果,并且仍然能够获取该结果。 Is there an any type that I can use in the query or a '*' for example. 我可以在查询中使用任何类型还是例如“ *”。

如果我正确理解,则可以尝试使用

item.Location.Contains(location)

您是否正在寻找这样的东西?

&& (string.IsNullOrEmpty(location) || item.location == location) &&

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM