public async Task <IViewComponentResult> InvokeAsync()
        {
            var user = await _userManager.FindByIdAsync(_httpContextAccessor.HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier));

            var roleId         = _context.UserRoles.Where(x => x.UserId == user.Id).ToList()[0].RoleId;
            var roleClaims     = _context.RoleClaims.Where(x => x.RoleId == roleId).ToList();
            var rolePermission = _context.RolePermission.ToList().Where(x => x.IsActive);

            var claims = new HashSet <string>(roleClaims.Select(claim => claim.ClaimValue));

            rolePermission = rolePermission.Where(x => claims.Contains(x.Slug)).ToList();

            var menuGroups = rolePermission.OrderBy(x => x.DisplayOrder).GroupBy(g => g.Group).ToList();
            var menuList   = new List <NavigationViewModel>();

            foreach (var menuGroup in menuGroups)
            {
                var menu = new NavigationViewModel
                {
                    Group        = TextUtility.CamelCaseTranslation(menuGroup.Select(x => x.Group).FirstOrDefault()),
                    DisplayOrder = menuGroup.Select(y => y.DisplayOrder).FirstOrDefault(),
                    Icon         = menuGroup.Select(y => y.Icon).FirstOrDefault(),
                    GroupIcon    = menuGroup.Select(y => y.GroupIcon).FirstOrDefault()
                };
                var menuItemList = new List <NavigationItems>();
                if (menuGroup.Any())
                {
                    foreach (var menuLists in menuGroup)
                    {
                        var navigationItems = new NavigationItems
                        {
                            MenuName     = menuLists.MenuName,
                            ItemIcons    = menuLists.Icon,
                            Links        = menuLists.Link,
                            SubGroup     = menuLists.SubGroup,
                            SubGroupIcon = menuLists.GroupIcon
                        };
                        menuItemList.Add(navigationItems);
                    }
                }

                menu.MenuItems = menuItemList;
                menuList.Add(menu);
            }
            menuList = menuList.OrderBy(x => x.DisplayOrder).ToList();
            return(View(menuList));
        }
        /// <summary>
        /// Adds role permission to AuthRolePermission table which are not present
        /// </summary>
        /// <param name="context"></param>
        private static void AddAuthRolePermissions(AuthenticationDbContext context)
        {
            var existingRolePermission = context.RolePermission;
            var roleList = PermissionsLists.GetLists();

            foreach (var roleClaim in roleList)
            {
                string slug         = roleClaim.Split('|')[0];
                string group        = roleClaim.Split('|')[1];
                string subGroup     = roleClaim.Split('|')[2];
                string menuName     = roleClaim.Split('|')[3];
                string menuIcon     = roleClaim.Split('|')[4];
                string menuIsActive = roleClaim.Split('|')[5];
                string order        = roleClaim.Split('|')[6];
                string groupIcon    = roleClaim.Split('|')[7];
                string link         = roleClaim.Split('|')[8];
                string subGroupName = roleClaim.Split('|')[9];
                if (!existingRolePermission.Any(m => m.Slug == slug))
                {
                    var authRolePermission = new RolePermission
                    {
                        CreatedDate  = DateTime.UtcNow,
                        Name         = TextUtility.CamelCaseTranslation(menuName),
                        Slug         = slug,
                        Group        = TextUtility.CamelCaseTranslation(group),
                        SubGroup     = string.IsNullOrEmpty(subGroup) ? "" : TextUtility.CamelCaseTranslation(subGroup),
                        MenuName     = TextUtility.CamelCaseTranslation(menuName),
                        Icon         = menuIcon,
                        IsActive     = menuIsActive == "Y" ? true : false,
                        DisplayOrder = Convert.ToInt32(order),
                        GroupIcon    = groupIcon,
                        Link         = link,
                        SubGroupName = subGroupName
                    };
                    context.RolePermission.Add(authRolePermission);
                    context.SaveChanges();
                }
            }
        }