確かに、チュートリアルでは実際にデータを保存する方法も示しています - ToDo リスト項目。以下のリンク先のステップ 8 にInsertAsync
、関連付けられたスクリプトを起動する呼び出しが表示されます。または、Windows Azure ポータルからセットアップできるデモ アプリを使用した場合は、次のようなコードが表示されます。
private async void InsertTodoItem(TodoItem todoItem)
{
// This code inserts a new TodoItem into the database. When the operation completes
// and Mobile Services has assigned an Id, the item is added to the CollectionView
await todoTable.InsertAsync(todoItem);
items.Add(todoItem);
}
...
private void ButtonSave_Click(object sender, RoutedEventArgs e)
{
var todoItem = new TodoItem { Text = TextInput.Text };
InsertTodoItem(todoItem);
}
その後、Windows Azure ポータルで、データベースに入る前にオブジェクトを操作する必要がある場合は、node.js スクリプトを使用してそれを行うことができます。たとえば、以下の画像は、コード内Text
で のTodoItem
が設定されたものをハードコードされた「置換されたテキスト」に置き換える方法を示しています。
