Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }