Class TemplateModelComparerFactory
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Factory class responsible for creating a System.Collections.Generic.IComparer<T> for a specific model type.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.DataAbstraction.RuntimeModel.Internal
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7Syntax
[ServiceConfiguration(typeof(ITemplateModelComparerFactory))]
public class TemplateModelComparerFactory : ITemplateModelComparerFactory
Remarks
The default implementation will create a comparer that looks at the inheritance chain for where the IRenderTemplate<TModel> for the model type is implemented. And then compare the generic types in the inheritance chain and sort so the model with "shortest" inheritance is inserted before in list. If no IRenderTemplate<TModel> is found (e.g. when explicitly registered partial MVC view) it will be considered prioritized, e.g. inserted before the other item in the list.
Constructors
TemplateModelComparerFactory()
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the TemplateModelComparerFactory class.
Declaration
protected TemplateModelComparerFactory()
Remarks
Provided for use when testing or overriding the default implementation.
TemplateModelComparerFactory(TypeRelater)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the TemplateModelComparerFactory class.
Declaration
public TemplateModelComparerFactory(TypeRelater typeRelater)
Parameters
Type | Name | Description |
---|---|---|
TypeRelater | typeRelater | The type relater. |
Methods
Create(Type)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Creates a new System.Collections.Generic.IComparer<T> for the specified model type.
Declaration
public virtual IComparer<TemplateModel> Create(Type modelType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | modelType | Type of the model that the comparison should be made on. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IComparer<TemplateModel> |