Ejemplo n.º 1
0
        public VersionedUrlTagHelper(
            IHostingEnvironment hostingEnvironment,
            IMemoryCache cache,
            IOptions <VersionedAssetsOptions> options,
            HtmlEncoder htmlEncoder)
        {
            if (hostingEnvironment == null)
            {
                throw new ArgumentNullException(nameof(hostingEnvironment));
            }
            if (cache == null)
            {
                throw new ArgumentNullException(nameof(cache));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (htmlEncoder == null)
            {
                throw new ArgumentNullException(nameof(htmlEncoder));
            }

            lazyHashProvider = new Lazy <FileHashProvider>(() => new FileHashProvider(
                                                               hostingEnvironment.WebRootFileProvider,
                                                               cache,
                                                               ViewContext.HttpContext.Request.PathBase));

            this.options     = options.Value;
            this.htmlEncoder = htmlEncoder;
        }
 public VersionedAssetsBuilder(VersionedAssetsOptions options)
 {
     this.Options = options;
 }