For the hot water crust pastry:
1. Warm a mixing bowl and sift in the flour. Make a well in the centre.
2. Heat the butter and the milk until just boiling and pour into the well in the flour. Mix quickly.
3. Continue mixing the pastry until the dough is smooth.
For the filling:
1. Preheat the oven to 180°C/Gas 4. Divide the pastry into two balls, keeping one a little larger than the other.
2. Melt the butter in a pan and gently fry the onions on a low heat until soft, then leave to cool.
3. Mix the onions into a bowl with the grated cheese, eggs, cream and the seasoning, and mix thoroughly with your fingers.
4. Roll out the larger ball of pastry into a lined greased baking tin. Tip the cheese and onion mixture into the pastry shell. Moisten the edges of the pastry and cover with the rolled-out top piece, crimping the edges together carefully.
5. Brush beaten egg over the top, make a hole in the middle and bake in the oven for 50 mins until golden brown and the cheese is bubbling from the hole.
Allow to cool before serving.