[configure] Add new target.
[mono-project.git] / mcs / tests / test-async-49.cs
blobe76faf8a832460f6db997cc0dec2e1c5ee8bacad
1 using System;
2 using System.Linq;
3 using System.Collections.Generic;
4 using System.Threading.Tasks;
6 class TodoItem
10 internal class MobileServiceTable2<T>
12 public Task<List<T>> ToListAsync ()
14 var r = new List<T> ();
15 r.Add (default (T));
16 return Task.FromResult<List<T>> (r);
20 public class Tests
22 int foo (Action t)
24 t ();
25 return 0;
28 private void OnTap (TodoItem task)
32 private async Task RefreshAsync ()
34 var ta = new MobileServiceTable2<TodoItem> ();
35 var r = await ta.ToListAsync ();
37 r.Select<TodoItem, int> (t => foo (() => OnTap (t))).ToList ();
40 public static void Main (String[] args)
42 var t = new Tests ();
43 t.RefreshAsync ().Wait ();