private async Task UpdateChart() { this.Stocks.Clear(); using (var context = new MarketContext()) { foreach (var stock in await context.Stocks.Where(s => s.CompanyId == this.SelectedCompany.Id).ToListAsync()) { this.Stocks.Add(stock); } } this.ChangeSeriesLegend(); }
private async Task InitialLoad() { List <Company> items = null; using (var context = new MarketContext()) { items = await context.Companies.ToListAsync(); } this.Companies.Clear(); foreach (var company in items) { this.Companies.Add(company); } if (this.Companies.Count != 0) { this.SelectedCompany = this.Companies[0]; } }