3
Answers

what is the context class in mvc

Mark Tabor

Mark Tabor

8y
588
1
I want to make a dynamic menu in my MVC website i am very new to MVC i do not know more about it . I am following this article for dynamic menu generation 
http://www.thecrazyprogrammer.com/2015/02/create-dynamic-menu-in-aspnet-mvc.html
 
here is the code of, what is ProjectEntities() what is should write there instead of ProjectEntities() .
 

2
3
4
5
6
7
8
9
10
11
12
13
14
public static class MyMenu
{
/// <summary>
/// Get List of All Menu Items from Database
/// </summary>
/// <returns>Returns List<Menus> object</returns>
public static List<Menus> GetMenus()
{
using(var context = new ProjectEntities())
{
return context.Menu.ToList();
}
}
}
 
Answers (3)