public async Task <List <ISiteHost> > GetSiteHosts(int siteId) { 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> > 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); }