Beispiel #1
0
        /// <summary>
        /// pass in -1 for currentSiteId to get all sites
        /// </summary>
        /// <param name="currentSiteId"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public async Task <List <ISiteInfo> > GetPageOtherSites(
            int currentSiteId,
            int pageNumber,
            int pageSize,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            List <ISiteInfo> sites = new List <ISiteInfo>();

            using (DbDataReader reader = await dbSiteSettings.GetPageOfOtherSites(
                       currentSiteId,
                       pageNumber,
                       pageSize,
                       cancellationToken))
            {
                while (reader.Read())
                {
                    SiteInfo site = new SiteInfo();
                    site.LoadFromReader(reader);
                    sites.Add(site);
                }
            }

            return(sites);
        }
Beispiel #2
0
        /// <summary>
        /// pass in -1 for currentSiteId to get all sites
        /// </summary>
        /// <param name="currentSiteId"></param>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public async Task <List <ISiteInfo> > GetPageOtherSites(
            int currentSiteId,
            int pageNumber,
            int pageSize)
        {
            List <ISiteInfo> sites = new List <ISiteInfo>();

            using (DbDataReader reader = dbSiteSettings.GetPageOfOtherSites(currentSiteId, pageNumber, pageSize))
            {
                while (reader.Read())
                {
                    SiteInfo site = new SiteInfo();
                    site.LoadFromReader(reader);
                    sites.Add(site);
                }
            }

            return(sites);
        }