public async Task<ActionResult> Edit(EditViewModel editViewModel)
        {
            if (editViewModel == null)
            {
                throw new HttpException(400, "Bad Request");
            }

            var role = await RoleManager.FindByIdAsync(editViewModel.Id);
            if (role == null)
            {
                throw new HttpException(404, "Not Found");
            }

            Session["RoleName"] = editViewModel.Name;

            role.Name = editViewModel.Name;
            role.Description = editViewModel.Description;
            var result = await RoleManager.UpdateAsync(role);
            if (result.Succeeded)
            {
                TempData["RoleId"] = role.Id;
                TempData["RoleName"] = role.Name;
                TempData["Message"] = RolesMessage.EditSuccess;
                return RedirectToAction("index", "roles");
            }
            AddErrors(result);

            return View(editViewModel);
        }
        public async Task<ActionResult> Edit(int? id)
        {
            if (id == null)
            {
                throw new HttpException(400, "Bad Request");
            }

            var role = await RoleManager.FindByIdAsync(id.Value);
            if (role == null)
            {
                throw new HttpException(404, "Not Found");
            }

            Session["RoleName"] = role.Name;

            var editViewModel = new EditViewModel()
            {
                Id = role.Id,
                Name = role.Name,
                Description = role.Description
            };
            return View(editViewModel);
        }