Beispiel #1
0
        public async Task <Planet> GetPlanet(int planetId)
        {
            var planet = await context.FindAsync <Planet>(planetId);

            await context.Entry(planet).Collection(p => p.Moons).LoadAsync();

            await context.Entry(planet).Collection(p => p.TradePoints).LoadAsync();

            foreach (var moon in planet.Moons)
            {
                await context.Entry(moon).Collection(m => m.TradePoints).LoadAsync();
            }

            return(planet);
        }
Beispiel #2
0
 protected override async Task LoadEntity(Trader entity)
 {
     await context.Entry(entity).Collection(to => to.TradeOffers).LoadAsync();
 }