public override string[] GetUsersInRole(string roleName)
        {
            var roleid = Context.GetRoleID(roleName);
            var join   = Context.GetUserInRole(roleid).Select(s => UserRoleMapper.UserID(s));

            return(GetUsernameArray(join.ToArray()));
        }
        public override bool IsUserInRole(string username, string roleName)
        {
            var userid = GetUserID(username);
            var roleid = Context.GetRoleID(roleName);
            var join   = UserRoleHelper.New();

            UserRoleMapper.UserID(join, userid)
            .RoleID(join, roleid);

            return(Context.IsJoinExist(join));
        }
        public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames)
        {
            var userid = GetUserIDArray(usernames);
            var roleId = Context.GetRoleID(roleNames);
            var list   = new List <TUserRole>();

            foreach (var rid in roleId)
            {
                foreach (var uid in userid)
                {
                    var rjoin = UserRoleHelper.New();
                    UserRoleMapper.UserID(rjoin, uid)
                    .RoleID(rjoin, rid);
                    list.Add(rjoin);
                }
            }

            Context.RemoveUsersFromRoles(list);
        }