Ejemplo n.º 1
0
        private static void GetStadiumWithClub()
        {
            var clubWithoutStadium = _context.Set <Stadium>().Find(3);

            var clubWithStadium = _context.Clubs.Include(c => c.Stadium)
                                  .FirstOrDefault(c => c.Stadium.Id == 3);

            var clubsWithStadiums = _context.Clubs
                                    .Where(c => c.Stadium != null)
                                    .Select(c => new { Stadium = c.Stadium, Club = c })
                                    .ToList();
        }
 public EfRepository(FootballManagerContext context)
 {
     Context  = context;
     Entities = context.Set <T>();
 }