I have a table menu
in Sql Server and I'm trying to do a recursive function that loads the menu with all of its children, now my table menu
has the following:
Where ParentID
has the id
of the parent that corresponds to that child, what I need is to be able to get this menu in a list to be able to go through it in the view and show that menu.
Suppose we have a Menu list that represents the list of everything in the database.
public void ObtenerMenu(List<Menu> lista)
{
for (int i=0; i<lista.Count; i++)
{
}
}