Class ContentModel<TContent>
Represents a strongly-typed model for the current Umbraco view.
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public class ContentModel<TContent> : ContentModel, IContentModel where TContent : IPublishedContent
Type Parameters
| Name | Description |
|---|---|
| TContent | The type of the published content, which must implement IPublishedContent. |
Remarks
This generic class extends ContentModel to provide type-safe access to the content in Umbraco views and controllers.
Constructors
View SourceContentModel(TContent)
Initializes a new instance of the ContentModel<TContent> class with a content.
Declaration
public ContentModel(TContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| TContent | content |
Properties
View SourceContent
Gets the content.
Declaration
public TContent Content { get; }
Property Value
| Type | Description |
|---|---|
| TContent |