public ActionResult Menu()
 {
     var pvm = new ProtocolsViewModel(ConfigurationRepository);
     var list = pvm.Protocols.Where(x => x.Enabled).ToArray();
     if (list.Length > 0)
     {
         var vm = new ChildMenuViewModel();
         vm.Items = list.Select(x =>
             new ChildMenuItem
             {
                 Controller = "Protocol",
                 Action = "Protocol",
                 Title = x.Name,
                 RouteValues = new { id = x.NameWithoutSpaces }
             }).ToArray();
         return PartialView("ChildMenu", vm);
     }
     return new EmptyResult();
 }
예제 #2
0
 public ActionResult Menu()
 {
     var list = new IdentityProvidersViewModel(this.identityProviderRepository);
     if (list.IdentityProviders.Any())
     {
         var vm = new ChildMenuViewModel
         {
             Items = list.IdentityProviders.Select(x =>
                 new ChildMenuItem
                 {
                     Controller = "IP",
                     Action = "IP",
                     Title = x.Name,
                     RouteValues = new { id = x.ID }
                 }).ToArray()
         };
         return PartialView("ChildMenu", vm);
     }
     return new EmptyResult();
 }
 public ActionResult Menu()
 {
     var list = new OAuthClientIndexViewModel(this.clientRepository);
     if (list.Clients.Any())
     {
         var vm = new ChildMenuViewModel
         {
             Items = list.Clients.Select(x =>
                 new ChildMenuItem
                 {
                     Controller = "OAuthClient",
                     Action = "Edit",
                     Title = x.Name,
                     RouteValues = new { id = x.ID }
                 }).ToArray()
         };
         return PartialView("ChildMenu", vm);
     }
     return new EmptyResult();
 }