A classic Egyptian street food with numerous varieties, all versions of koshary consist of a combination of chickpeas, lentils, rice, and/or pasta, a flavorful tomato sauce, and sweet crispy onions.
In a sauce pan heat oil over medium-high. Add grated onions and cook until translucent and just beginning to brown. Add garlic, harissa, and cumin, continuing to cook until fragrant.
Add tomato paste and cook, stirring, until well mixed and darkens in color. Add diced tomatoes, vinegar, salt, and black pepper. Bring to a boil, reduce heat and simmer until slightly thickened, about 30 minutes.
Remove from heat and transfer to a blender. Purée until smooth. Hold hot for service or cool completely and reheat as needed.
Fried Onions
In a pan with tall enough sides to allow for onions to float in oil, heat oil over medium-high. Once hot, add onions and sugar. Stirring frequently, cook onions until browned. Use a slotted spoon to remove onions from oil and allow to drain on towel. Hold warm, making just prior to service. Oil can be reserved and used as desired, or discarded.
Starch Base
Place rice in container and cover with water. Soak rice for 15 minutes and drain. Set aside.
Add lentils to a pot and cover with an excess amount of water. Bring to a boil, reduce heat to low and cook until tender but not fully cooked, about 10 minutes. Drain from water.
In a sauce pot heat oil over medium-high heat. Add soaked rice, par-cooked lentils, salt, black pepper, and coriander. Cook, stirring, until lightly toasted, about 3 minutes. Add enough warm water to cover rice and lentils with roughly 1/2" of water. Bring to a boil, reduce heat to low, cover, and cook until water is fully absorbed and rice is cooked through, about 20 minutes. Remove from heat and let stand 5 minutes.
Fluff rice lentil mixture with a fork and gently fold in cooked pasta and chickpeas. Hold hot for service.
Service
For each serving, portion 1 1/2 cups starch base onto desired plate or bowl. Top with 3/4 cup tomato sauce and 1/2 cup fried onions. Serve warm with vinegar if desired.