Exemple #1
0
        public IEnumerable <ResourceItem> GetResources(string fullPath)
        {
            var encodedPath = ResourcePathHelper.EncodeAsResourcesPath(fullPath);

            if (encodedPath.Length > 0 && !encodedPath.EndsWith("."))
            {
                encodedPath = encodedPath + ".";
            }

            // We will assume that any file starting with this path, is in that directory.
            // NOTE: This may include false positives, but helps in the majority of cases until
            // https://github.com/aspnet/FileSystem/issues/184 is solved.

            return(_resources.Value.Where(k => k.Key.StartsWith(encodedPath)).Select(d => d.Value));
        }
Exemple #2
0
        /// <inheritdoc/>
        public ResourceItem GetResource(string fullPath)
        {
            var encodedPath = ResourcePathHelper.EncodeAsResourcesPath(fullPath);

            return(_resources.Value.GetOrDefault(encodedPath));
        }