//
 // GET: /Roles/
 public ActionResult Index()
 {
     RoleViewModel roleViewModel = new RoleViewModel();
     roleViewModel.Roles = RoleManager.Roles.ToList();
     return View(roleViewModel);
 }
 public async Task<ActionResult> Create(RoleViewModel roleViewModel)
 {
     if (ModelState.IsValid)
     {
         var role = new AspNetRole();
         role.Name = roleViewModel.Name;
         int rolesCount = RoleManager.Roles.Count() + 1;
         role.Id = rolesCount.ToString();
         if (!RoleManager.RoleExists(role.Name))
         {
             var roleresult = await RoleManager.CreateAsync(role);
             if (!roleresult.Succeeded)
             {
                 TempData["message"] = new MessageViewModel
                 {
                     Message = "Error in creating role",
                     IsError = true
                 };
                 return View();
             }
             TempData["message"] = new MessageViewModel
             {
                 Message = "Role has been created successfully",
                 IsSaved = true
             };
         }
         return RedirectToAction("Index");
     }
     return View();
 }
 //
 // GET: /Roles/Edit/Admin
 public async Task<ActionResult> Edit(string id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     var role = await RoleManager.FindByIdAsync(id);
     if (role == null)
     {
         return HttpNotFound();
     }
     RoleViewModel roleModel = new RoleViewModel { Id = role.Id, Name = role.Name };
     return View(roleModel);
 }