private async void Init() { await Task.Run(() => { List <KeyValuePair <string, (DateTime, double)> > list = new List <KeyValuePair <string, (DateTime, double)> >(); SelectAll().ToObservable().Subscribe(a => { lock (list) { list.AddRange(a); } model.OnNext(list.AsEnumerable()); }); }); }
private async void Init() { await System.Threading.Tasks.Task.Run(() => GetAll().SelectMany(a => a).AsParallel().ToArray()) .ContinueWith(async a => model.OnNext(await a), TaskScheduler.FromCurrentSynchronizationContext()); }