public AspnetUsersInRole GetAspnetUsersInRole(AspnetRole role, AspnetUser user)
 {
     UserRoleIdentifier id = new UserRoleIdentifier();
     id.RoleId = role.RoleId;
     id.UserId = user.UserId;
     return _aspnetUsersInRoleDao.GetById(id);
 }
 public int UpdateAspnetRole(AspnetRole aspRole)
 {
     _aspnetRoleDao.Update(aspRole);
     if (aspRole != null)
         return 1;
     return 0;
 }
 public int SaveAspnetRole(AspnetRole aspRole)
 {
     _aspnetRoleDao.Save(aspRole);
     if (aspRole != null)
         return 1;
     return 0;
 }
Beispiel #4
0
 public void Update(AspnetRole entity)
 {
     CurrentSession.Update(entity);
 }
Beispiel #5
0
 public Guid Save(AspnetRole entity)
 {
     return (Guid)CurrentSession.Save(entity);
 }
Beispiel #6
0
 public void Delete(AspnetRole entity)
 {
     CurrentSession.Delete(entity);
 }
        //#region Operations
        /// <summary>
        /// Adds a new role to the data source for the configured application name.
        /// </summary>
        /// <param name="roleName">the name of the role to create.</param>
        public override void CreateRole(string roleName)
        {
            if (roleName.Contains(","))
            {
                throw new ArgumentException("Role names cannot contain commas.");
            }

            // Make sure we are not attempting to insert an existing role.
            if (RoleExists(roleName))
            {
                throw ExceptionUtil.NewProviderException(this, Resources.Role_AlreadyExists);
            }

            try
            {
                AspnetRole role = new AspnetRole();
                role.RoleName = roleName;
                role.LoweredRoleName = roleName.ToLowerInvariant();
                role.AspnetApplication = application;
                _aspnetRoleService.SaveAspnetRole(role);
            }
            catch (Exception ex)
            {
                throw ExceptionUtil.NewProviderException(this, Resources.Role_UnableToCreate, ex);
            }
        }
 public void DeleteRole(AspnetRole aspRole)
 {
     _aspnetRoleDao.Delete(aspRole);
 }