c# - 从移动服务表获取数据

标签 c# azure windows-mobile

我想从 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/

相关文章:

azure - 监控 Azure 应用服务

php - 如何使用 PHP sdk 将 Azure blob 复制到 Assets ?

c++ - 如何在 Windows Mobile 中以 C++ 编程方式获取任何进程使用的内存

c# - 继承 WPF 按钮并在其中添加额外的文本 block

c# - 弹跳城堡 C# : How to Implement EllipticCurve Encryption/Decryption

c# - 关于 C# 中线程的奇怪消息

azure - 在同一区域的不同 Azure 应用服务中运行相同的自定义域

c# - GPS Windows Mobile 6(使用 Microsoft.WindowsMo​​bile.Samples.Location;)

c++ - 如何估计线程上下文切换开销?

c# - .net 中的二进制序列化/反序列化对象图大小是否有任何限制?