public void RemoveRole(Role role)
 {
   Delete<Role>(role);
 }
Beispiel #2
0
    public override void CreateRole(string roleName)
    {
      if (string.IsNullOrEmpty(roleName))
        throw new ArgumentException("roleName");

      var role = mvcMembershipService.GetRole(roleName);
      if (role != null)
        throw new InvalidOperationException("Role exists: " + roleName);

      var newRole = new Role()
      {
        RoleID_pk = Guid.NewGuid(),
        RoleName = roleName
      };
      mvcMembershipService.AddRole(newRole);
      mvcMembershipService.SaveChanges();
    }
 public void AddRole(Role role)
 {
   Add<Role>(role);
   SaveChanges();
 }