SaaS CMS has officially launched! Learn more now.

Class ViewRegistrator

Scan views for partial block views.

Inheritance
System.Object
ViewRegistrator
Implements
Namespace: EPiServer.DataAbstraction.RuntimeModel.Internal
Assembly: EPiServer.Cms.AspNetCore.Mvc.dll
Version: 12.0.3
Syntax
public class ViewRegistrator : Object, IViewRegistrator

Constructors

ViewRegistrator(ITypeScannerLookup, IEnumerable<IContentTypeModelScanner>, ITemplateRepository, ICompositeViewEngine, IVirtualPathResolver)

Initializes a new instance of the ViewRegistrator class.

Declaration
public ViewRegistrator(ITypeScannerLookup typeScannerLookup, IEnumerable<IContentTypeModelScanner> contentTypeModelScanner, ITemplateRepository templateModelRepository, ICompositeViewEngine viewEngine, IVirtualPathResolver virtualPathResolver)
Parameters
Type Name Description
ITypeScannerLookup typeScannerLookup
System.Collections.Generic.IEnumerable<IContentTypeModelScanner> contentTypeModelScanner
ITemplateRepository templateModelRepository
Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngine viewEngine
IVirtualPathResolver virtualPathResolver

Methods

RegisterTemplate(Type, TemplateModel, Boolean)

Called when a template given by TemplateModel is registered for a System.Type.

Declaration
protected virtual void RegisterTemplate(Type modelType, TemplateModel templateModel, bool throwOnAlreadyRegisteredView)
Parameters
Type Name Description
System.Type modelType

Type of the model.

TemplateModel templateModel

The template model.

System.Boolean throwOnAlreadyRegisteredView

Indication if an excpetion should be thrown if there is already a view template registered with same name

Exceptions
Type Condition
System.NotSupportedException

RegisterViews(HttpContext)

Registers the scanned views in the EPiServer.DataAbstraction.Internal.DefaultTemplateRepository.

Declaration
public virtual void RegisterViews(HttpContext httpContext)
Parameters
Type Name Description
Microsoft.AspNetCore.Http.HttpContext httpContext

The http context.

Implements

Extension Methods