/// <summary> /// Initializes a new instance of <see cref="MvcRazorHost"/> using the specified <paramref name="chunkTreeCache"/>. /// </summary> /// <param name="chunkTreeCache">An <see cref="IChunkTreeCache"/> rooted at the application base path.</param> /// <param name="resolver">The <see cref="ITagHelperDescriptorResolver"/> used to resolve tag helpers on razor views.</param> public ShapeRazorHost(IChunkTreeCache chunkTreeCache, IHttpContextAccessor httpContextAccessor, ITagHelperDescriptorResolver resolver) : base(chunkTreeCache, resolver) { // We need to resolve the services using the scoped service provider // explicitly as IRazorViewEngine which is resolving IMvcRazorHost is // itself coming from the root service provider. // It's fine in this context as the TagHelperMvcRazorHost registration is Transient // which means we are not keeping any reference on IShapeTableManager and IThemeManager TagHelperDescriptorResolver = new ShapeTagHelperDescriptorResolver( new TagHelperTypeResolver(), new TagHelperDescriptorFactory(designTime: false), httpContextAccessor ); }
public TagHelperMvcRazorHost( IChunkTreeCache chunkTreeCache, IHttpContextAccessor httpContextAccessor) : base(chunkTreeCache) { // We need to resolve the services using the scoped service provider // explicitly as IRazorViewEngine which is resolving IMvcRazorHost is // itself coming from the root service provider. // It's fine in this context as the TagHelperMvcRazorHost registration is Transient // which means we are not keeping any reference on IShapeTableManager and IThemeManager TagHelperDescriptorResolver = new ShapeTagHelperDescriptorResolver( new TagHelperTypeResolver(), httpContextAccessor ); }