Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class TemplateConventions

Inheritance
System.Object
TemplateConventions
Namespace: EPiServer.Scanning.Internal
Assembly: EPiServer.Cms.AspNetCore.Templating.dll
Version: 12.0.3
Syntax
public static class TemplateConventions : Object

Methods

GetRenderTemplateModelType(Type)

Gets the model type of the specified render template. This method returns null if IRenderTemplate<TModel> is not implemented. If more than one IRenderTemplate<TModel> is implemented this method will throw an exception.

Declaration
public static Type GetRenderTemplateModelType(Type templateType)
Parameters
Type Name Description
System.Type templateType
Returns
Type Description
System.Type
Exceptions
Type Condition
System.Reflection.AmbiguousMatchException

Thrown if the type has multiple implementations of IRenderTemplate<TModel>.

IsRenderTemplate(Type)

Determines whether the type is a render template implementation, i.e. a non abstract or generic type definition that implements the IRenderTemplate interface.

Declaration
public static bool IsRenderTemplate(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Boolean