Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentModel<TContent>

    Represents a strongly-typed model for the current Umbraco view.

    Inheritance
    object
    ContentModel
    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 Source

    ContentModel(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 Source

    Content

    Gets the content.

    Declaration
    public TContent Content { get; }
    Property Value
    Type Description
    TContent
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX