Esempio n. 1
0
        public async Task <IList <IUserInfo> > GetUsersInRole(
            int siteId,
            int roleId,
            string searchInput,
            int pageNumber,
            int pageSize)
        {
            IList <IUserInfo> users = new List <IUserInfo>();

            if (multiTenantOptions.UseRelatedSitesMode)
            {
                siteId = multiTenantOptions.RelatedSiteId;
            }

            using (DbDataReader reader = dbRoles.GetUsersInRole(siteId, roleId, searchInput, pageNumber, pageSize))
            {
                while (reader.Read())
                {
                    UserInfo user = new UserInfo();
                    user.LoadFromReader(reader);
                    users.Add(user);
                }
            }

            return(users);
        }
        public async Task <IList <IUserInfo> > GetUsersInRole(
            int siteId,
            int roleId,
            string searchInput,
            int pageNumber,
            int pageSize,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            IList <IUserInfo> users = new List <IUserInfo>();

            using (DbDataReader reader = dbRoles.GetUsersInRole(siteId, roleId, searchInput, pageNumber, pageSize))
            {
                while (reader.Read())
                {
                    UserInfo user = new UserInfo();
                    user.LoadFromReader(reader);
                    users.Add(user);
                }
            }

            return(users);
        }