The exception explains clearly that there is only one asynchronous operation per context allowed at a time.
So, you either have to await
them one at a time as the error message suggests:
var banner = await context.Banners.ToListAsync();
var newsGroup = await context.NewsGroups.ToListAsync();
Or you can use multiple contexts:
var banner = context1.Banners.ToListAsync();
var newsGroup = context2.NewsGroups.ToListAsync();
await Task.WhenAll(banner, newsGroup);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…