我想从 Azure 获取数据。这是我的代码:
private async void FindPromotion()
{
MobileServiceCollection<Promotions, Promotions> result;
MobileServiceInvalidOperationException exception = null;
string _place = textInputPlace.Text;
if (_place!= null)
{
try
{
//lista obiektów Category
result = await todoTable2.Where(todoItem => todoItem.Place==_place)
.Select(todoItem => todoItem.Products, todoItem => todoItem.Description)
.ToCollectionAsync();
}
catch (MobileServiceInvalidOperationException ex)
{
exception = ex;
}
if (exception != null)
{
await new MessageDialog(exception.Message, "Can't find items").ShowAsync();
}
else
{
ListItems.ItemsSource = result.Distinct();
}
}
}
我有错误:
“Select”方法没有重载,需要 2 个参数。
有人知道吗?还有另一种获取此数据的方法吗?
最佳答案
这是选择多列的方法:
result = await todoTable2.Select(todoItem => new { todoItem.Products , todoItem.Description}).ToCollectionAsync();
关于c# - 从移动服务表获取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34384643/