Choose a new cookbook worth up to £28 when you subscribe to our magazine.
First, make the pastry. Tip the flours into a medium bowl with the cayenne, onion seeds, parmesan and a generous pinch of salt. Rub in the butter until the mixture resembles breadcrumbs, then pour in half the egg and 2 tbsp cold water and bring everything together using your hands. Knead a couple of times until smooth. Flatten a third of the dough into a disc, then do the same with the remaining dough. Wrap both pastry discs and chill in the fridge for at least 30 mins. Will keep chilled for up to two days.
Meanwhile, make the filling. Heat the butter in a saucepan over a medium heat until sizzling, then scatter in the onions, bay, thyme, a large pinch of salt and good grinding of black pepper. Stir, then cook slowly for 10 mins until the onions have cooked down and started to caramelise. Stir in the sliced potatoes, cover and cook for 8-10 mins more, stirring occasionally until the potatoes are soft and starting to break down. Stir in the cream, remove the pan from the heat and leave to cool. Once cool, remove and discard the bay, then fold in the cheese.
Roll the smaller pastry disc out on a lightly floured surface to the size of a dinner plate and lift onto a baking sheet lined with baking parchment. Roll out the remaining pastry disc along with any offcuts to a circle about 5cm wider than the first. Spoon the filling into the middle of the smaller circle on the baking sheet, leaving a 4cm border. Brush the exposed border with some of the remaining beaten egg, then drape over the larger pastry circle. Tuck the edge around the filling to enclose it, as if making a giant ravioli. Trim the edge to neaten, then crimp with a cutlery knife handle or fork to seal. Brush the pie all over with most of the remaining beaten egg, and use any trimmings to make decorations, if you like.
Heat the oven to 210C/190C fan/gas 7. Bake the pie for 35-40 mins until deeply golden, brushing with the rest of the beaten egg halfway through. Leave to cool on the baking sheet for at least 20 mins before cutting into wedges, or leave to cool completely and serve cold.