public async Task<List<ISiteHost>> GetSiteHosts(int siteId) { List<ISiteHost> hosts = new List<ISiteHost>(); using (DbDataReader reader = await dbSiteSettings.GetHostList(siteId)) { while (reader.Read()) { SiteHost host = new SiteHost(); host.LoadFromReader(reader); hosts.Add(host); } } return hosts; }
public async Task<ISiteHost> GetSiteHost(string hostName) { using (DbDataReader reader = await dbSiteSettings.GetHost(hostName)) { while (reader.Read()) { SiteHost host = new SiteHost(); host.LoadFromReader(reader); return host; } } return null; }
public async Task<List<ISiteHost>> GetPageHosts( int pageNumber, int pageSize) { List<ISiteHost> hosts = new List<ISiteHost>(); using (DbDataReader reader = await dbSiteSettings.GetPageHosts(pageNumber, pageSize)) { while (reader.Read()) { SiteHost host = new SiteHost(); host.LoadFromReader(reader); hosts.Add(host); } } return hosts; }
public List<ISiteHost> GetAllHostsNonAsync() { List<ISiteHost> hosts = new List<ISiteHost>(); using (DbDataReader reader = dbSiteSettings.GetAllHostsNonAsync()) { while (reader.Read()) { SiteHost host = new SiteHost(); host.LoadFromReader(reader); hosts.Add(host); } } return hosts; }
public async Task<ISiteHost> GetSiteHost(string hostName, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); using (DbDataReader reader = dbSiteSettings.GetHost(hostName)) { while (reader.Read()) { SiteHost host = new SiteHost(); host.LoadFromReader(reader); return host; } } return null; }
public async Task<List<ISiteHost>> GetSiteHosts(int siteId, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); List<ISiteHost> hosts = new List<ISiteHost>(); using (DbDataReader reader = dbSiteSettings.GetHostList(siteId)) { while (reader.Read()) { SiteHost host = new SiteHost(); host.LoadFromReader(reader); hosts.Add(host); } } return hosts; }
public async Task<List<ISiteHost>> GetPageHosts( int pageNumber, int pageSize, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); List<ISiteHost> hosts = new List<ISiteHost>(); using (DbDataReader reader = await dbSiteSettings.GetPageHosts( pageNumber, pageSize, cancellationToken)) { while (reader.Read()) { SiteHost host = new SiteHost(); host.LoadFromReader(reader); hosts.Add(host); } } return hosts; }