5 tablespoons butter, plus more for baking dish
1/2 medium onion, chopped fine
2 cloves garlic, minced
3 cups fresh whole corn kernels (thawed, if frozen)
Kosher salt and freshly ground black pepper
1 teaspoon smoked paprika
1/4 teaspoon cayenne pepper
1/4 cup all-purpose flour
2 cups half-and-half
5 large eggs
1 cup grated extra-sharp white Cheddar