示例#1
0
        public static Item GetSettingsItem(this SiteContext site)
        {
            if (site == null)
            {
                throw new ArgumentNullException(nameof(site));
            }

            var defaultSettingsItem = site.GetRootItem().Children
                .FirstOrDefault(x => x.Name == "Settings");

            if (defaultSettingsItem == null)
            {
                throw new ArgumentNullException("Site settings not found", nameof(site));
            }

            return defaultSettingsItem;
        }