public void RegisterLink(LinkEntry link)
        {
            if (_links == null)
            {
                _links = new List <LinkEntry>();
            }

            var href = link.Href;

            if (href != null && href.StartsWith("~/", StringComparison.Ordinal))
            {
                link.Href = _pathBase + href.Substring(1);
            }

            _links.Add(link);
        }
Esempio n. 2
0
        public void RegisterLink(LinkEntry link)
        {
            if (_links == null)
            {
                _links = new List <LinkEntry>();
            }

            var href = link.Href;

            if (href != null && href.StartsWith("~/", StringComparison.Ordinal))
            {
                link.Href = _options.ContentBasePath + href.Substring(1);
            }

            if (link.AppendVersion)
            {
                link.Href = _fileVersionProvider.AddFileVersionToPath(_options.ContentBasePath, link.Href);
            }

            _links.Add(link);
        }