public async Task<ActionResult> Edit(RoleModificationModel model)
 {
     IdentityResult result;
     if (ModelState.IsValid)
     {
         foreach (string userId in model.IDsToAdd??new string[] {})
         {
             result = await UserManager.AddToRoleAsync(userId, model.RoleName);
             if (!result.Succeeded)
             {
                 return View("Error", result.Errors);
             }
         }
         foreach (var userId in model.IDsToDelete??new string[] {})
         {
             //演示用,正式部署时去掉
             var currentUser = await UserManager.FindByIdAsync(userId);
             if (currentUser.UserName=="Admin"  && model.RoleName=="Administrator"  )
             {
                 return View("Error", new string[] { "请勿修改Admin的角色!" });
             }
             
             result = await UserManager.RemoveFromRoleAsync(userId, model.RoleName);
             if (!result.Succeeded)
             {
                 return View("Error", result.Errors);
             }
         }
         return RedirectToAction("Index");
     }
     return View("Error",new string[] {"无法找到此角色"});
 }
 public async Task<ActionResult> Edit(RoleModificationModel model)
 {
     IdentityResult result;
     if (ModelState.IsValid)
     {
         foreach (string userId in model.IdsToAdd??new string[]{})
         {
             result = await UserManager.AddToRoleAsync(userId, model.RoleName);
             if (!result.Succeeded)
             {
                 return View("Error", result.Errors);
             }
             
         }
         foreach (string userId in model.IdsToDelete??new string[]{})
         {
             result = await UserManager.RemoveFromRoleAsync(userId, model.RoleName);
             if (!result.Succeeded)
             {
                 return View("Error", result.Errors);
             }
         }
         return RedirectToAction("Index");
     }
     return View("Error", new string[] { "角色没有找到" });
 }