예제 #1
0
        public async Task <ISiteSettings> Fetch(int siteId, CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            SiteSettings site = new SiteSettings();

            using (DbDataReader reader = await dbSiteSettings.GetSite(siteId))
            {
                if (reader.Read())
                {
                    site.LoadFromReader(reader);
                }
            }

            if (site.SiteGuid == Guid.Empty)
            {
                return(null);
            }                                                //not found

            //TODO: unless we also need a synchronous version of this method
            // the below should be made async
            //List<ExpandoSetting> expandoProperties = GetExpandoProperties(site.SiteId);
            //site.LoadExpandoSettings(expandoProperties);

            return(site);
        }
예제 #2
0
        public async Task <ISiteSettings> Fetch(
            int siteId,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            SiteSettings site = new SiteSettings();

            using (DbDataReader reader = await dbSiteSettings.GetSite(siteId, cancellationToken))
            {
                if (reader.Read())
                {
                    site.LoadFromReader(reader);
                }
            }

            if (site.SiteGuid == Guid.Empty)
            {
                return(null);
            }                                                //not found

            //List<ExpandoSetting> expandoProperties = GetExpandoProperties(site.SiteId);
            //site.LoadExpandoSettings(expandoProperties);

            return(site);
        }
예제 #3
0
        public async Task <ISiteSettings> Fetch(int siteId)
        {
            SiteSettings site = new SiteSettings();

            using (DbDataReader reader = await dbSiteSettings.GetSite(siteId))
            {
                if (reader.Read())
                {
                    site.LoadFromReader(reader);
                }
            }

            if (site.SiteGuid == Guid.Empty)
            {
                return(null);
            }                                                //not found

            List <ExpandoSetting> expandoProperties = GetExpandoProperties(site.SiteId);

            site.LoadExpandoSettings(expandoProperties);

            return(site);
        }