This is a modified version of another recipe on this site, http://www.geniuskitchen.com/recipe/really-good-vegetarian-meatloaf-really-33921. The original recipe didn't work too well for us: the onions were raw, and it lacked texture and interest.
Add salt to water and boil in a saucepan. Add lentils and simmer uncovered 10-15 minutes, until lentils are soft and most of water has evaporated. Drain and partially mash lentils. Scrape into mixing bowl and allow to cool slightly.
Meanwhile, fry the onions, garlic and celery until soft (10-15 minutes). Add grated carrot and fry for another 10 minutes. Add to the mixing bowl, followed by the oats, tomato sauce, cheese, basil, parsley and seasoning (salt and pepper) and mix well. Mix in the egg last, to avoid cooking it too much in the warm mixture.
Spoon into loaf pan or baking dish (9") that has been generously sprayed with Pam (non-stick cooking spray) or well-greased. Smooth top with back of spoon. Bake at 350 degrees for 30- 45 minutes until top of loaf is dry, firm and golden brown.
Cool in pan on rack for about 10 minutes. Run a sharp knife around edges of pan then turn out loaf onto serving platter.