Beispiel #1
0
        public async Task <List <NavigationMenu> > GetNavigationMenus(int applicationId)
        {
            using (var ctx = new MenuManagementDevContext())
            {
                var result = await ctx.NavigationMenu.Where(m => m.ApplicationId == applicationId).ToListAsync();

                return(result);
            }
        }
Beispiel #2
0
        public async Task <ILookup <int, NavigationMenu> > GetNavigationMenusChildren(IEnumerable <int> ids)
        {
            using (var ctx = new MenuManagementDevContext())
            {
                var result = await ctx.NavigationMenu.Where(m => ids.Contains(m.Id)).ToListAsync();

                return(result.ToLookup(n => n.ParentId.GetValueOrDefault()));
            }
        }
Beispiel #3
0
        public async Task <ILookup <int, RoleNavigationMenu> > GetRoleNavigationMenus(IEnumerable <int> navigationIds)
        {
            using (var ctx = new MenuManagementDevContext())
            {
                var result = await ctx.RoleNavigationMenu.Where(m => navigationIds.Contains(m.NavigationMenuId)).ToListAsync();

                return(result.ToLookup(r => r.NavigationMenuId));
            }
        }