Heat the oil in a fairly large saucepan and saute the onion and the garlic until the onion is soft.Add the stock and the rice ( if using) and simmer, covered, for 10 minutes.
Add the courgettes and season to taste with salt and pepper. Simmer until the courgettes are very tender- about 15 minutes.
In a soup tureen or similar beat the egg with the cheese and parsley, then whisk in the soup, mixing well.