Season the beef with salt and black pepper.
Heat an ovenproof casserole until hot. Add the vegetable oil and beef in batches and fry until browned. Return all the beef to the pan.
Add the cornflour and stir to coat the beef, then add the onions, carrots, thyme and mushrooms. Gently fry for 2-3 minutes.
Add the stock and bring to a simmer. Cover with a lid and simmer for 2-3 hours, or until the beef is very tender.
Season, to taste, with salt and black pepper, remove from the heat and set aside to cool.
Preheat the oven to 180C/350F/Gas 4.
Spoon the cooled meat mixture into a large pie dish.
Brush the edge of the dish with the beaten egg and then lay the pastry over the top of the filling and dish.
Crimp the edge to seal, then brush the pastry with more beaten egg and cut two slits in the top of the pie to let the steam escape.
Place on a baking tray in the oven for 25-35 minutes, or until the filling is hot and the pastry crisp and golden-brown.