AjaxItemSelect.Controllers.AccountController.Index C# (CSharp) Метод

Index() приватный Метод

private Index ( ) : System.Web.Mvc.ActionResult
Результат System.Web.Mvc.ActionResult
        public ActionResult Index()
        {
            // Users, names only

            // Get all users
            var allUsers = UserManager.Users;

            // Fetch the user names
            string userNames = "";
            foreach (var user in allUsers)
            {
                userNames += "<br />" + user.UserName;
            }

            // Add this data to the ViewBag
            ViewBag.UserNames = userNames;

            // Claims, raw view

            // Is authenticated?
            string status = Request.IsAuthenticated
                ? User.Identity.Name + " is authenticated"
                : "Anonymous";

            // Fetch the claims
            if (Request.IsAuthenticated)
            {
                var identity = User.Identity as ClaimsIdentity;
                var claims = identity.Claims.Select(c => new { Type = c.Type, Value = c.Value }).AsEnumerable();
                foreach (var claim in claims)
                {
                    status += "<br />" + claim.Type + " = " + claim.Value;
                }
            }

            // Add this data to the ViewBag
            ViewBag.Status = status;

            return View();
        }