public MenuViewModel GetMenu(int MenuId) { MenuViewModel menuviewmodel = (from M in _unitOfWork.Repository <Menu>().Instance join C in _unitOfWork.Repository <ControllerAction>().Instance on M.ControllerActionId equals C.ControllerActionId into ControllerActionTable from ControllerActionTab in ControllerActionTable.DefaultIfEmpty() where M.MenuId == MenuId select new MenuViewModel { MenuId = M.MenuId, ControllerName = ControllerActionTab.ControllerName ?? M.ControllerName, ActionName = ControllerActionTab.ActionName ?? M.ActionName, RouteId = M.RouteId, URL = M.URL, ModuleId = M.ModuleId, SubModuleId = M.SubModuleId, AreaName = M.AreaName }).FirstOrDefault(); //MenuViewModel menuviewmodel = (from M in _MenuRepository.Instance // join C in _ControllerActionRepository.Instance on M.ControllerActionId equals C.ControllerActionId into ControllerActionTable // from ControllerActionTab in ControllerActionTable.DefaultIfEmpty() // where M.MenuId == MenuId // select new MenuViewModel // { // MenuId = M.MenuId, // ControllerName = ControllerActionTab.ControllerName, // ActionName = ControllerActionTab.ActionName, // RouteId = M.RouteId, // URL = M.URL, // ModuleId = M.ModuleId, // SubModuleId = M.SubModuleId, // AreaName = M.AreaName // }).FirstOrDefault(); return(menuviewmodel); }
public MenuViewModel GetMenu(int MenuId) { MenuViewModel menuviewmodel = (from M in _MenuRepository.Instance join C in _ControllerActionRepository.Instance on M.ControllerActionId equals C.ControllerActionId into ControllerActionTable from ControllerActionTab in ControllerActionTable.DefaultIfEmpty() where M.MenuId == MenuId select new MenuViewModel { MenuId = M.MenuId, ControllerName = ControllerActionTab.ControllerName, ActionName = ControllerActionTab.ActionName, RouteId = M.RouteId, URL = M.URL, ModuleId = M.ModuleId, SubModuleId = M.SubModuleId, AreaName = M.AreaName }).FirstOrDefault(); return(menuviewmodel); }