Mark Tabor

Mark Tabor

  • 589
  • 2k
  • 460.2k

what is the context class in mvc

May 2 2016 10:53 AM
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)