public void Build(ApartmentRentingPOCDbContext context) { //Add a room var rooms = new List <Room>(); rooms.Add(Room.Create(1, 2, 3)); //Add an apartment context.Apartments.Add(Apartment.Create("testname", "teststreet", "testzipcode", "testcity", rooms)); context.SaveChanges(); }