Preheat the oven to 200°C (400°F/Gas 6).
Unwrap the pastry and stretch the first piece out onto a baking tray lined with baking parchment.
Spread it with the tomato sauce, leaving a border of 2 cm (¾ in) clear around the edges. If you are using passata, it is generally unseasoned so sprinkle with a little salt and pepper as necessary.
Now scatter over the cheese, followed by the ham, respecting the clear border.
Lay the second sheet of pastry on a lightly floured surface and score shallow, diagonal cuts across its surface, to make a diamond pattern. Lay the scored pastry over the first sheet.
Use your fingertips to push the two layers of pastry together around the edges and seal with the prongs of a fork to make little lines around the border.
Brush the top with a thin layer of the seasoned beaten egg (this will make it more golden). Keep the rest of the egg for later. Use the tip of a sharp knife to make around 10 small holes in the pastry, to allow the air to escape.
Let the pie rest in the fridge or a cool place for 10 minutes, then brush it with egg again.
Bake for 20 minutes or until golden brown, then turn the oven down to 170°C (340°F/Gas 3) and bake for a further 10–15 minutes.
Remove from the oven and allow to cool for a few minutes before serving. It is also good eaten at room temperature.
