1. Rinse the potatoes, place them in a glass baking dish with half a cup of water, cover and cook for 5 minutes in the microwave (800 W). Let cool, peel and cut into 1 cm thick slices. Place the leeks in the glass baking dish with a cup of water and a pinch of salt, cover, and cook for 4 minutes in the microwave (800 W). Drain.
2. Preheat the oven to 180°C (350°F). Peel and chop the shallot, sauté it for 2 minutes in a non-stick skillet with the margarine. Add the leeks and cook for 2 minutes. In a bowl, whisk the egg with the cornstarch and milk. Season with salt, pepper, and a pinch of nutmeg. Stir in half of the gruyere cheese and the leeks.
3. Grease a 18 cm (7 inch) diameter baking dish with oil, arrange the potato slices, season with salt and pepper. Pour the egg mixture over the potatoes. Sprinkle with the remaining gruyere cheese. Bake for 15 minutes. Let cool. Serve warm or cold.