Class ContentControllerBase
An abstract base controller used for media/content/members to try to reduce code replication.
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Namespace: Umbraco.Cms.Web.BackOffice.Controllers
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[JsonDateTimeFormat]
public abstract class ContentControllerBase : BackOfficeNotificationsController
Constructors
View SourceContentControllerBase(ICultureDictionary, ILoggerFactory, IShortStringHelper, IEventMessagesFactory, ILocalizedTextService, IJsonSerializer)
Initializes a new instance of the Content
Declaration
protected ContentControllerBase(ICultureDictionary cultureDictionary, ILoggerFactory loggerFactory, IShortStringHelper shortStringHelper, IEventMessagesFactory eventMessages, ILocalizedTextService localizedTextService, IJsonSerializer serializer)
Parameters
| Type | Name | Description |
|---|---|---|
| ICulture |
cultureDictionary | |
| Microsoft. |
loggerFactory | |
| IShort |
shortStringHelper | |
| IEvent |
eventMessages | |
| ILocalized |
localizedTextService | |
| IJson |
serializer |
Properties
View SourceCultureDictionary
Gets the
Declaration
protected ICultureDictionary CultureDictionary { get; }
Property Value
| Type | Description |
|---|---|
| ICulture |
EventMessages
Gets the
Declaration
protected IEventMessagesFactory EventMessages { get; }
Property Value
| Type | Description |
|---|---|
| IEvent |
LocalizedTextService
Gets the
Declaration
protected ILocalizedTextService LocalizedTextService { get; }
Property Value
| Type | Description |
|---|---|
| ILocalized |
LoggerFactory
Gets the Microsoft.
Declaration
protected ILoggerFactory LoggerFactory { get; }
Property Value
| Type | Description |
|---|---|
| Microsoft. |
ShortStringHelper
Gets the
Declaration
protected IShortStringHelper ShortStringHelper { get; }
Property Value
| Type | Description |
|---|---|
| IShort |
Methods
View SourceAddCancelMessage(INotificationModel, String)
Adds a cancelled message to the display
Declaration
protected void AddCancelMessage(INotificationModel display, string message)
Parameters
| Type | Name | Description |
|---|---|---|
| INotification |
display | |
| System. |
message |
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. |
display | |
| System. |
messageArea | |
| System. |
messageAlias | |
| System. |
messageParams |
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.
HandleContentNotFound(Object)
Handles if the content for the specified ID isn't found
Declaration
protected NotFoundObjectResult HandleContentNotFound(object id)
Parameters
| Type | Name | Description |
|---|---|---|
| System. |
id | The content ID to find |
Returns
| Type | Description |
|---|---|
| Microsoft. |
The error response |