C# Class Sdl.Web.Common.Models.EntityModel

Abstract base class for View Models for Entities.
Inheritance: ViewModel, IRichTextFragment, IEntity
Afficher le fichier Open project: sdl/dxa-web-application-dotnet Class Usage Examples

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
DeepCopy ( ) : ViewModel

Creates a deep copy of this View Model.

Equals ( object obj ) : bool

Determines whether the specified object is equal to the current Entity Model.

GetDefaultView ( Sdl.Web.Common.Configuration.Localization localization ) : MvcData

Gets the default View for this Entity Model (if any).

If this method is overridden in a subclass, it will be possible to render "embedded" Entity Models of that type using the Html.DxaEntity method.

GetHashCode ( ) : int

Serves as a hash function for a particular type.

GetXpmMarkup ( Sdl.Web.Common.Configuration.Localization localization ) : string

Gets the rendered XPM markup

ToHtml ( ) : string

Gets an HTML representation of the Entity Model.

This method is used when the EntityModel is part of a RichText instance which is mapped to a string property. In this case HTML rendering happens during model mapping (by means of this method), which is not ideal. Preferably, the model property should be of type RichText and the View should use @Html.DxaRichText() to get the rich text rendered as HTML.

ToString ( ) : string

Returns a string that represents the current object.

Method Details

DeepCopy() public méthode

Creates a deep copy of this View Model.
public DeepCopy ( ) : ViewModel
Résultat ViewModel

Equals() public méthode

Determines whether the specified object is equal to the current Entity Model.
public Equals ( object obj ) : bool
obj object The object to compare with the current object.
Résultat bool

GetDefaultView() public méthode

Gets the default View for this Entity Model (if any).
If this method is overridden in a subclass, it will be possible to render "embedded" Entity Models of that type using the Html.DxaEntity method.
public GetDefaultView ( Sdl.Web.Common.Configuration.Localization localization ) : MvcData
localization Sdl.Web.Common.Configuration.Localization The context Localization.
Résultat MvcData

GetHashCode() public méthode

Serves as a hash function for a particular type.
public GetHashCode ( ) : int
Résultat int

GetXpmMarkup() public méthode

Gets the rendered XPM markup
public GetXpmMarkup ( Sdl.Web.Common.Configuration.Localization localization ) : string
localization Sdl.Web.Common.Configuration.Localization The context Localization.
Résultat string

ToHtml() public méthode

Gets an HTML representation of the Entity Model.
This method is used when the EntityModel is part of a RichText instance which is mapped to a string property. In this case HTML rendering happens during model mapping (by means of this method), which is not ideal. Preferably, the model property should be of type RichText and the View should use @Html.DxaRichText() to get the rich text rendered as HTML.
/// This method must be overridden in a concrete subclass which is to be embedded in rich text. /// For example, see . ///
public ToHtml ( ) : string
Résultat string

ToString() public méthode

Returns a string that represents the current object.
public ToString ( ) : string
Résultat string