public AspnetUsersInRole GetAspnetUsersInRole(AspnetRole role, AspnetUser user)
 {
     UserRoleIdentifier id = new UserRoleIdentifier();
     id.RoleId = role.RoleId;
     id.UserId = user.UserId;
     return _aspnetUsersInRoleDao.GetById(id);
 }
Exemplo n.º 2
0
 public int UpdateAspnetRole(AspnetRole aspRole)
 {
     _aspnetRoleDao.Update(aspRole);
     if (aspRole != null)
         return 1;
     return 0;
 }
Exemplo n.º 3
0
 public int SaveAspnetRole(AspnetRole aspRole)
 {
     _aspnetRoleDao.Save(aspRole);
     if (aspRole != null)
         return 1;
     return 0;
 }
Exemplo n.º 4
0
 public void Update(AspnetRole entity)
 {
     CurrentSession.Update(entity);
 }
Exemplo n.º 5
0
 public Guid Save(AspnetRole entity)
 {
     return (Guid)CurrentSession.Save(entity);
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 8
0
 public void DeleteRole(AspnetRole aspRole)
 {
     _aspnetRoleDao.Delete(aspRole);
 }