public DatosController(TempDbContext context, ParkingDbContext parkingDbContext) { _context = context; _parkingDbContext = parkingDbContext; if (_parkingDbContext.Places.Any()) { return; } for (int i = 0; i < 32; i++) { floors[i] = new Place { PlaceId = i + 1, PlaceNumber = i + 1, State = false }; } foreach (var item in floors) { _parkingDbContext.Places.Add(item); } _parkingDbContext.SaveChangesAsync(); }