@using CPRNIMS.Infrastructure.ViewModel; @using CPRNIMS.Infrastructure.ViewModel.Account; @using CPRNIMS.Infrastructure.ViewModel.Common; @inject CPRNIMS.Domain.UIContracts.Account.IAccount _account; @model CPRNIMS.Infrastructure.Dto.Attachement.AttachResponseDto @{ if (!String.IsNullOrEmpty(ViewBag.UserRoles)) { try { string allowedRoles = ViewBag.UserRoles; var userCred = new CPRNIMS.Infrastructure.Models.Account.User(); userCred.UserName = ViewBag.UserName; userCred.UserId = ViewBag.UserId; var myControllerAccess = await _account.GetLandingPageByUserId(userCred); var groupedElements = myControllerAccess.GroupBy(e => e.ElementMenuName).ToList(); // Pass the data to the view ViewBag.TempDataElements = groupedElements; } catch (Exception) { // Console.WriteLine(ex.Message.ToString() ?? ex.InnerException?.ToString()); throw; } } }