I need to load a menu from the database in the view of my .net mvc project

0

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++)
     {

      }
} 
    
asked by Raidel Fonseca 16.01.2018 в 15:31
source

0 answers