public async Task <List <ISiteHost> > GetAllHosts() { List <ISiteHost> hosts = new List <ISiteHost>(); using (DbDataReader reader = dbSiteSettings.GetAllHosts()) { while (reader.Read()) { SiteHost host = new SiteHost(); host.LoadFromReader(reader); hosts.Add(host); } } return(hosts); }
public async Task <List <ISiteHost> > GetAllHosts(CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); List <ISiteHost> hosts = new List <ISiteHost>(); using (DbDataReader reader = dbSiteSettings.GetAllHosts()) { while (reader.Read()) { SiteHost host = new SiteHost(); host.LoadFromReader(reader); hosts.Add(host); } } return(hosts); }