Class ModelMerger
Handles merging of values defined on models/code for PropertyDefinition and ContentType.
Inheritance
Inherited Members
Namespace: EPiServer.DataAbstraction.RuntimeModel
Assembly: EPiServer.dll
Version: 9.12.2Syntax
[ServiceConfiguration]
public class ModelMerger
Constructors
ModelMerger(IContentModelUsage)
Initializes a new instance of the ModelMerger class.
Declaration
public ModelMerger(IContentModelUsage contentModelUsage)
Parameters
Type | Name | Description |
---|---|---|
IContentModelUsage | contentModelUsage | The content model usage. |
Properties
AlwaysUseModelName
Gets or sets a value indicating whether the merger should force the model name to always be used.
Declaration
public static bool AlwaysUseModelName { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
MergeModelSettings(ContentType, ContentTypeModel)
Merges the model settings from model
into the version of contentType
.
Declaration
public virtual void MergeModelSettings(ContentType contentType, ContentTypeModel model)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | Type of the content. |
ContentTypeModel | model | The model. |
Remarks
Only seetings on contentType
that does not have a value will have it's value merged from model
.
MergePropertySettings(PropertyDefinition, PropertyDefinitionModel, ITabDefinitionRepository)
Merges the model settings from model
into the version of propertyDefinition
.
Declaration
public virtual void MergePropertySettings(PropertyDefinition propertyDefinition, PropertyDefinitionModel model, ITabDefinitionRepository tabDefinitionRepository)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinition | propertyDefinition | The property definition. |
PropertyDefinitionModel | model | The model. |
ITabDefinitionRepository | tabDefinitionRepository | The tab definition repository. |
Remarks
Only settings on propertyDefinition
that does not have a value will have it's value merged from model
.
RemoveModelSettings(ContentType, ContentTypeModel)
Removes all values from contentType
that have values that corresponds with values on model
.
Declaration
public virtual void RemoveModelSettings(ContentType contentType, ContentTypeModel model)
Parameters
Type | Name | Description |
---|---|---|
ContentType | contentType | Type of the content. |
ContentTypeModel | model | The model. |
RemovePropertyModelSettings(PropertyDefinition, PropertyDefinitionModel)
Removes all values from propertyDefinition
that have values that corresponds with values on model
.
Declaration
public virtual void RemovePropertyModelSettings(PropertyDefinition propertyDefinition, PropertyDefinitionModel model)
Parameters
Type | Name | Description |
---|---|---|
PropertyDefinition | propertyDefinition | The property definition. |
PropertyDefinitionModel | model | The model. |