public string ResolveResourceUrl(string resourceUrl) { string resolvedPath; if (_resourceUrlMap.TryGetValue(resourceUrl, out resolvedPath)) { return(resolvedPath); } //if the url was not in the prepopulated resource url map, then it is still possible that it matches a pattern //of a group. Thus, we need to check the inner group manager. This is an edge case that should really only happen //if you are trying to include a resource path that does not actually exist. However, we need to handle it //because otherwise things will work differently when running in a precompiled state, and that would not be good. return(_unconsolidatedResourceUrlMap.GetOrAdd(resourceUrl, () => _inner.ResolveResourceUrl(resourceUrl))); }
private IEnumerable <string> GetResourceUrls(IResourceGroupManager groupManager, string resourceUrl) { IEnumerable <string> resolvedResourceUrls; if (groupManager.IsGroupUrlWithConsolidationDisabled(resourceUrl)) { resolvedResourceUrls = groupManager.GetResourceUrlsInGroup(resourceUrl, _finder) .SortByDependencies(_dependencyManager); } else { resolvedResourceUrls = new[] { groupManager.ResolveResourceUrl(resourceUrl) }; } if (!String.IsNullOrEmpty(Version)) { return(resolvedResourceUrls.Select(u => u.AddQueryParam("v", Version))); } else { return(resolvedResourceUrls); } }
public string ResolveResourceUrl(string resourceUrl) { return(_resolvedResourceUrls.GetOrAdd(resourceUrl, () => _inner.ResolveResourceUrl(resourceUrl))); }