C# Класс Sdl.Web.Common.Models.EntityModel

Abstract base class for View Models for Entities.
Наследование: ViewModel, IRichTextFragment, IEntity
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
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.

Описание методов

DeepCopy() публичный Метод

Creates a deep copy of this View Model.
public DeepCopy ( ) : ViewModel
Результат ViewModel

Equals() публичный Метод

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.
Результат bool

GetDefaultView() публичный Метод

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.
Результат MvcData

GetHashCode() публичный Метод

Serves as a hash function for a particular type.
public GetHashCode ( ) : int
Результат int

GetXpmMarkup() публичный Метод

Gets the rendered XPM markup
public GetXpmMarkup ( Sdl.Web.Common.Configuration.Localization localization ) : string
localization Sdl.Web.Common.Configuration.Localization The context Localization.
Результат string

ToHtml() публичный Метод

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
Результат string

ToString() публичный Метод

Returns a string that represents the current object.
public ToString ( ) : string
Результат string