public JsonResult DeleteRole(long id, DateTime modifiedOn) { var response = securityRepository.DeleteRole(id, modifiedOn); modifiedOn = modifiedOn.ToUniversalTime(); ClearCache(response); return(Json(response, JsonRequestBehavior.AllowGet)); }
public void DeleteRole(Guid id, ref ValidationStateDictionary states) { ValidationState v = new ValidationState(); bool result = repositoryInstance.DeleteRole(id); if (!result) { v.Errors.Add(new ValidationError("RoleName.UsserExistForTheRole", null, "Role cannot be deleted as there are users with that role. Re-assign the user to another role an try again.")); states.Add(typeof(Role), v); } }