public ActionResult Edit(int? id)
        {
            Client client = null;
            if (id != null && id > 0)
            {
                client = this.clientRepository.Get(id.Value);
                if (client == null) return HttpNotFound();
            }
            else
            {
                client = new Client();
            }

            var vm = new OAuthClientViewModel(client); 
            return View("Edit", vm);
        }
        public ActionResult Edit(string id)
        {
            Client client;
            if (!String.IsNullOrEmpty(id))
            {
                client = ClientRepository.Get(id);
                if (client == null) return HttpNotFound();
            }
            else
            {
                client = new Client();
            }

            var vm = new OAuthClientViewModel(client); 
            return View("Edit", vm);
        }
 public ActionResult Index()
 {
     var vm = new OAuthClientViewModel(this.clientRepository);
     return View("Index", vm);
 }
 public ActionResult Menu()
 {
     var list = new OAuthClientViewModel(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();
 }