示例#1
0
        /// <summary>
        ///     Get an item using the generic content repository
        /// </summary>
        /// <returns>The Hero datasource item from the Content API</returns>
        public IHero GetHeroItems()
        {
            var dataSource = _renderingRepository.GetDataSource();

            // Basic example of using the wrapped logger
            if (string.IsNullOrEmpty(dataSource))
            {
                _logRepository.Warn(Logging.Error.DataSourceError);
            }

            return(_contentRepository.GetContentItem <IHero>(dataSource));
        }
示例#2
0
        /// <summary>
        ///     Get an item using the generic content repository
        /// </summary>
        /// <returns>The Hero datasource item from the Content API</returns>
        public IHero GetHeroItems()
        {
            var dataSource = _renderingRepository.GetDataSource();

            return(_contentRepository.GetContentItem <IHero>(dataSource));
        }