If you are going to make your own pastry, do this first. Dice the butter and mix with the flour until it resembles breadcrumbs. Then add a small amount of ice cold water and mix until the pastry comes together. Form a ball, wrap in clingfilm, and pop in the fridge to rest.
Dice a large potato (I don't bother peeling it) into sugar cube sized chunks, and boil in salted water for 5 minutes until just tender.
Drain the potato in a sieve and then use the same saucepan to fry diced onion in a little vegetable oil.
Mix the potato with the onion and allow to cool.
Open your tin of corned beef and chop it into bite sized chunks. Mix with the onion and potato mixture.
Preheat the oven to 180 fan or 190 otherwise / gas mark 6.
Take your pastry out of the fridge and remove a third of the pastry and set it aside (this will be for the lid).
Roll out the larger piece of pastry to around 3mm thick circle, and use to line your pie dish (which you have lightly greased with oil).
Put the corned beef mixture into the pie case and flatten it down. Brush the edges of the pastry with a little beaten egg if you are using, or milk.
Roll out the smaller piece of pastry to a circle and place over the top of the pie.
Press down the top and bottom pastry so they are stuck together, and then crimp the sides shut with your fingers or the edge of a fork.
Make a hole in the centre of the lid for steam to escape.
Brush the top of the pie with egg wash (optional).
Bake the pie at 180 degrees fan / 190 degrees without fan / gas mark 6, for around 45 minutes until the top and sides are golden brown.
Allow to cool slightly before removing from the pie dish.
Serve warm or cold. Keeps in the fridge for 3 days.