Example #1
0
        public async Task <List <ISiteHost> > GetAllHosts()
        {
            List <ISiteHost> hosts = new List <ISiteHost>();

            using (DbDataReader reader = await dbSiteSettings.GetAllHosts())
            {
                while (reader.Read())
                {
                    SiteHost host = new SiteHost();
                    host.LoadFromReader(reader);
                    hosts.Add(host);
                }
            }

            return(hosts);
        }
Example #2
0
        public async Task <List <ISiteHost> > GetAllHosts(CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();

            List <ISiteHost> hosts = new List <ISiteHost>();

            using (DbDataReader reader = await dbSiteSettings.GetAllHosts())
            {
                while (reader.Read())
                {
                    SiteHost host = new SiteHost();
                    host.LoadFromReader(reader);
                    hosts.Add(host);
                }
            }

            return(hosts);
        }