예제 #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);
        }
예제 #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);
        }