Interface ITemplateModelComparer
Defines the signature for a component used to determine which of two TemplateModel instances that is "closest" to modelType. This is used in TemplateModelRepository to determine the order in which TemplateModel instances are sorted.
Namespace: EPiServer.DataAbstraction.RuntimeModel
Assembly: EPiServer.dll
Version: 8.11.0Syntax
[Obsolete("Deprecated and replaced by use of standard IComparer<>")]
public interface ITemplateModelComparer
Methods
Compare(TemplateModel, TemplateModel, Type)
Compares two TemplateModel instances to determine their sort order for modelType
.
The implementation should follow:
Return less than zero: x is "closer" to modelType
than y. That is inserted before y in list.
Return zero: x is equally close to modelType
that y. In this case x gets after y in list.
Return greater than zero: y is "closer" to modelType
than x. That is x is inserted after y in list.
Declaration
int Compare(TemplateModel newModel, TemplateModel currentModel, Type modelType)
Parameters
Type | Name | Description |
---|---|---|
TemplateModel | newModel | The x. |
TemplateModel | currentModel | The y. |
System.Type | modelType | Type of the model. |
Returns
Type | Description |
---|---|
System.Int32 |