private static void ExplicitLoadFootballers() { var club = _context.Clubs.FirstOrDefault(c => c.ClubName.Contains("L")); _context.Entry(club).Collection(c => c.Footballers).Load(); _context.Entry(club).Reference(c => c.Coach).Load(); }
public void CanInsertClubIntoDatabase() { var builder = new DbContextOptionsBuilder(); builder.UseInMemoryDatabase("CanInsertClub"); using (var context = new FootballManagerContext(builder.Options)) { var club = new Club(); context.Clubs.Add(club); Assert.AreEqual(EntityState.Added, context.Entry(club).State); } }