public static BundleConfigurer AddJs(this BundleCollectionConfigurer @this, PathString path)
        {
            var bundle = new Bundle(path, @this.GetDefaults(JsBundleConfiguration.BundleType));

            @this.Bundles.Add(bundle);
            return(new BundleConfigurer(bundle, @this.Bundles.SourceFileProvider, @this.AppServices));
        }
        public static BundleCollectionConfigurer LoadFromConfigFile(this BundleCollectionConfigurer @this, TextReader reader,
                                                                    ConfigFilePathMapper pathMapper = null)
        {
            var configFileManager = @this.AppServices.GetRequiredService <IConfigFileManager>();

            configFileManager.Load(@this.Bundles, reader, pathMapper);

            return(@this);
        }
        public static BundleCollectionConfigurer LoadFromConfigFile(this BundleCollectionConfigurer @this, IFileInfo fileInfo,
                                                                    ConfigFilePathMapper pathMapper = null)
        {
            if (fileInfo == null)
            {
                throw new ArgumentNullException(nameof(fileInfo));
            }

            using (var stream = fileInfo.CreateReadStream())
                using (var reader = new StreamReader(stream))
                    return(@this.LoadFromConfigFile(reader, pathMapper));
        }
        public static JsBundleConfigurer AddJs(this BundleCollectionConfigurer configurer, PathString path)
        {
            if (configurer == null)
            {
                throw new ArgumentNullException(nameof(configurer));
            }

            var bundle = new Bundle(path, configurer.GetDefaults(JsBundleConfiguration.BundleType));

            configurer.Bundles.Add(bundle);
            return(new JsBundleConfigurer(bundle, configurer.Bundles.SourceFileProvider, configurer.Bundles.CaseSensitiveSourceFilePaths, configurer.AppServices));
        }
        public static BundleCollectionConfigurer LoadFromConfigFile(this BundleCollectionConfigurer configurer, TextReader reader,
                                                                    ConfigFilePathMapper pathMapper = null)
        {
            if (configurer == null)
            {
                throw new ArgumentNullException(nameof(configurer));
            }

            IConfigFileManager configFileManager = configurer.AppServices.GetRequiredService <IConfigFileManager>();

            configFileManager.Load(configurer.Bundles, reader, pathMapper);

            return(configurer);
        }
        public static BundleCollectionConfigurer LoadFromConfigFile(this BundleCollectionConfigurer @this, string path, IFileProvider fileProvider,
                                                                    ConfigFilePathMapper pathMapper = null)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            if (fileProvider == null)
            {
                throw new ArgumentNullException(nameof(fileProvider));
            }

            return(@this.LoadFromConfigFile(fileProvider.GetFileInfo(path), pathMapper));
        }