Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentControllerBase

    An abstract base controller used for media/content/members to try to reduce code replication.

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    UmbracoApiControllerBase
    UmbracoApiController
    UmbracoAuthorizedApiController
    UmbracoAuthorizedJsonController
    BackOfficeNotificationsController
    Namespace: Umbraco.Cms.Web.BackOffice.Controllers
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    [JsonDateTimeFormat]
    public abstract class ContentControllerBase : BackOfficeNotificationsController

    Constructors

    View Source

    ContentControllerBase(ICultureDictionary, ILoggerFactory, IShortStringHelper, IEventMessagesFactory, ILocalizedTextService, IJsonSerializer)

    Initializes a new instance of the ContentControllerBase class.

    Declaration
    protected ContentControllerBase(ICultureDictionary cultureDictionary, ILoggerFactory loggerFactory, IShortStringHelper shortStringHelper, IEventMessagesFactory eventMessages, ILocalizedTextService localizedTextService, IJsonSerializer serializer)
    Parameters
    Type Name Description
    ICultureDictionary cultureDictionary
    Microsoft.Extensions.Logging.ILoggerFactory loggerFactory
    IShortStringHelper shortStringHelper
    IEventMessagesFactory eventMessages
    ILocalizedTextService localizedTextService
    IJsonSerializer serializer

    Properties

    View Source

    CultureDictionary

    Gets the

    Declaration
    protected ICultureDictionary CultureDictionary { get; }
    Property Value
    Type Description
    ICultureDictionary
    View Source

    EventMessages

    Gets the

    Declaration
    protected IEventMessagesFactory EventMessages { get; }
    Property Value
    Type Description
    IEventMessagesFactory
    View Source

    LocalizedTextService

    Gets the

    Declaration
    protected ILocalizedTextService LocalizedTextService { get; }
    Property Value
    Type Description
    ILocalizedTextService
    View Source

    LoggerFactory

    Gets the Microsoft.Extensions.Logging.ILoggerFactory

    Declaration
    protected ILoggerFactory LoggerFactory { get; }
    Property Value
    Type Description
    Microsoft.Extensions.Logging.ILoggerFactory
    View Source

    ShortStringHelper

    Gets the

    Declaration
    protected IShortStringHelper ShortStringHelper { get; }
    Property Value
    Type Description
    IShortStringHelper

    Methods

    View Source

    AddCancelMessage(INotificationModel, String)

    Adds a cancelled message to the display

    Declaration
    protected void AddCancelMessage(INotificationModel display, string message)
    Parameters
    Type Name Description
    INotificationModel display
    System.String message
    View Source

    AddCancelMessage(Nullable<INotificationModel>, String, String, String[])

    Adds a cancelled message to the display

    Declaration
    protected void AddCancelMessage(INotificationModel? display, string messageArea = "speechBubbles", string messageAlias = "operationCancelledText", string[] messageParams = null)
    Parameters
    Type Name Description
    System.Nullable<INotificationModel> display
    System.String messageArea
    System.String messageAlias
    System.String[] messageParams
    View Source

    GetObjectFromRequest<TPersisted>(Func<TPersisted>)

    A helper method to attempt to get the instance from the request storage if it can be found there, otherwise gets it from the callback specified

    Declaration
    protected TPersisted GetObjectFromRequest<TPersisted>(Func<TPersisted> getFromService)
    Parameters
    Type Name Description
    Func<TPersisted> getFromService
    Returns
    Type Description
    TPersisted
    Type Parameters
    Name Description
    TPersisted
    Remarks

    This is useful for when filters have already looked up a persisted entity and we don't want to have to look it up again.

    View Source

    HandleContentNotFound(Object)

    Handles if the content for the specified ID isn't found

    Declaration
    protected NotFoundObjectResult HandleContentNotFound(object id)
    Parameters
    Type Name Description
    System.Object id

    The content ID to find

    Returns
    Type Description
    Microsoft.AspNetCore.Mvc.NotFoundObjectResult

    The error response

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ContentControllerBase(ICultureDictionary, ILoggerFactory, IShortStringHelper, IEventMessagesFactory, ILocalizedTextService, IJsonSerializer)
    • Properties
      • CultureDictionary
      • EventMessages
      • LocalizedTextService
      • LoggerFactory
      • ShortStringHelper
    • Methods
      • AddCancelMessage(INotificationModel, String)
      • AddCancelMessage(Nullable<INotificationModel>, String, String, String[])
      • GetObjectFromRequest<TPersisted>(Func<TPersisted>)
      • HandleContentNotFound(Object)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX