0

Windows Azure Mobile Services (c# Win RT アプリケーション) を使用しています。テーブル "Game" は、列 "PlayerName"、"PlayerMail"、および "PlayerAge" で構成されます。

例: 1 行目: ティム tim@hotmail.com 21 | 2 行目: 1 月 jan@hotmail.com 23

コード ビハインドでは、PlayerName がテキスト ボックスに入力された名前と等しいすべての行を尋ねています。PlayerName が Tim である行は 1 行だけです。その人のPlayerMailを取得して変数に入れたいです。これどうやってするの?

private IMobileServiceTable<Game> todoTable = App.MobileService.GetTable<Game>();

var player = Player.Text
var databynaam = await todoTable.Where(todoItem => todoItem.PlayerName == player).ToCollectionAsync();
4

1 に答える 1

2

この操作を使用して、Selectそのフィールドのみを選択できます。

IMobileServiceTable<Game> todoTable = App.MobileService.GetTable<Game>();
string player = Player.Text;
IEnumerable<string> emails = await todoTable
    .Where(game => game.PlayerName == player)
    .Select(game => game.PlayerMail)
    .ToEnumerableAsync();
string playerMail = emails.FirstOrDefault();
于 2013-06-01T14:37:51.210 に答える