Try our conversational search powered by Generative AI!

Class TemplateModelComparerFactory

Factory class responsible for creating a System.Collections.Generic.IComparer<T> for a specific model type.

Inheritance
System.Object
TemplateModelComparerFactory
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction.RuntimeModel
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class TemplateModelComparerFactory
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()

Initializes a new instance of the TemplateModelComparerFactory class.

Declaration
protected TemplateModelComparerFactory()
Remarks

Provided for use when testing or overriding the default implementation.

TemplateModelComparerFactory(TypeRelater)

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)

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>

Extension Methods