public BundleTagHelper(IHostingEnvironment hostingEnvironment, IMemoryCache cache, HtmlEncoder htmlEncoder, IUrlHelperFactory urlHelperFactory, BundleOptions options = null, IBundleProvider bundleProvider = null) { if (hostingEnvironment == null) { throw new ArgumentNullException(nameof(hostingEnvironment)); } if (cache == null) { throw new ArgumentNullException(nameof(cache)); } if (htmlEncoder == null) { throw new ArgumentNullException(nameof(htmlEncoder)); } if (urlHelperFactory == null) { throw new ArgumentNullException(nameof(urlHelperFactory)); } if (options == null) { options = new BundleOptions(); options.Configure(hostingEnvironment); } _bundleProvider = bundleProvider ?? new BundleProvider(hostingEnvironment); _options = options; _hostingEnvironment = hostingEnvironment; _cache = cache; _htmlEncoder = htmlEncoder; _urlHelperFactory = urlHelperFactory; }