public List<WebMenuRole> GetMenuItemsForRoles(List<string> roleNames)
{
using (var dbContext = new TimeTrackingEntities())
{
var menuRole = (from wm in dbContext.WebMenus
from role in wm.aspnet_Roles
where roleNames.Contains(role.RoleName)
select new WebMenuRole
{
MenuId = wm.MenuId,
MenuTitle = wm.Title,
Action = wm.Action,
Controller = wm.Controller,
OrderNumber = wm.OrderNumber,
}).Distinct().OrderBy(c=>c.OrderNumber).ToList();
return menuRole;
}
}