/// <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); }
public async Task <List <ISiteInfo> > GetList() { List <ISiteInfo> sites = new List <ISiteInfo>(); using (DbDataReader reader = await dbSiteSettings.GetSiteList()) { while (reader.Read()) { SiteInfo site = new SiteInfo(); site.LoadFromReader(reader); sites.Add(site); } } return(sites); }
public async Task <List <ISiteInfo> > GetList(CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); List <ISiteInfo> sites = new List <ISiteInfo>(); using (DbDataReader reader = dbSiteSettings.GetSiteList()) { while (reader.Read()) { SiteInfo site = new SiteInfo(); site.LoadFromReader(reader); sites.Add(site); } } return(sites); }
/// <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 = await dbSiteSettings.GetPageOfOtherSites(currentSiteId, pageNumber, pageSize)) { while (reader.Read()) { SiteInfo site = new SiteInfo(); site.LoadFromReader(reader); sites.Add(site); } } return(sites); }