从移动服务表中获取数据
本文关键字:获取 数据 移动 服务 | 更新日期: 2023-09-27 18:27:26
我想从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();