【发布时间】:2013-12-30 21:21:26
【问题描述】:
我正在尝试用 C# 构建一个操作 azure 移动服务表的 Windows 商店应用程序。我看了教程,但发现自己有一些错误:
1。我无法读取数据,我想我根本不懂教程。我可以修改 TodoItem 表,但是当涉及到不同的表(当然来自 azure 移动服务)时,我无法读取它:
我的 C# 代码:
using Microsoft.WindowsAzure.MobileServices;
using Newtonsoft.Json;
public class myTable
{
[JsonProperty(PropertyName = "column1")]
public string column1 { get; set; }
[JsonProperty(PropertyName = "column2")]
public string column2 { get; set; }
}
public MobileServiceCollection<myTable, myTable> collection;
public IMobileServiceTable<myTable> table = App.MobileService.GetTable<myTable>();
public static MobileServiceClient client = new MobileServiceClient(
"https://myMobileService.azure-mobile.net",
"xxxxxxxxxxxxxxxxxxxxxxxxxx"
);
//at this point I am pretty much lost... :s ...
天蓝色教程中的家伙使用以下方法 在 TodoItem 表中查询,但我还是不明白...
todoItem 是从哪里来的,我看不到它的任何 Initialize?现在,如何使用自己的代码执行查询????
private async void RefreshTodoItems()
{
// This query filters out completed TodoItems.
items = await todoTable
.Where(todoItem => todoItem.Complete == false)
.ToCollectionAsync();
ListItems.ItemsSource = items;
}
我有点迷路了,谢谢你的帮助。
【问题讨论】:
-
您在
GetTable调用中使用的fuel类的定义是什么? -
对不起,我本来打算写 myTable...
标签: c# sql windows-store-apps azure-mobile-services