View Source
Class TemplateController
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Assembly: Umbraco.Web.BackOffice.dll
Syntax
[Authorize(Policy = "TreeAccessTemplates")]
public class TemplateController : BackOfficeNotificationsController
Constructors
View Source
TemplateController(ITemplateService, IUmbracoMapper, IShortStringHelper, IDefaultViewContentProvider, IFileService)
Declaration
[ActivatorUtilitiesConstructor]
public TemplateController(ITemplateService templateService, IUmbracoMapper umbracoMapper, IShortStringHelper shortStringHelper, IDefaultViewContentProvider defaultViewContentProvider, IFileService fileService)
Parameters
Type |
Name |
Description |
ITemplateService |
templateService |
|
IUmbracoMapper |
umbracoMapper |
|
IShortStringHelper |
shortStringHelper |
|
IDefaultViewContentProvider |
defaultViewContentProvider |
|
IFileService |
fileService |
|
Methods
View Source
DeleteById(Int32)
Deletes a template with a given ID
Declaration
[HttpDelete]
[HttpPost]
public IActionResult DeleteById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
GetAll()
Declaration
public IEnumerable<EntityBasic>? GetAll()
Returns
Type |
Description |
System.Nullable<IEnumerable<EntityBasic>> |
|
View Source
GetByAlias(String)
Declaration
public TemplateDisplay? GetByAlias(string alias)
Parameters
Type |
Name |
Description |
System.String |
alias |
|
Returns
Type |
Description |
System.Nullable<TemplateDisplay> |
|
View Source
GetById(Guid)
Gets the template json for the template guid
Declaration
public ActionResult<TemplateDisplay?> GetById(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<TemplateDisplay>> |
|
View Source
GetById(Int32)
Gets the template json for the template id
Declaration
public ActionResult<TemplateDisplay?> GetById(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<TemplateDisplay>> |
|
View Source
GetById(Udi)
Gets the template json for the template udi
Declaration
public ActionResult<TemplateDisplay?> GetById(Udi id)
Parameters
Type |
Name |
Description |
Udi |
id |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<TemplateDisplay>> |
|
View Source
GetScaffold(Int32)
Declaration
public TemplateDisplay? GetScaffold(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
Type |
Description |
System.Nullable<TemplateDisplay> |
|
View Source
PostSave(TemplateDisplay)
Declaration
public ActionResult<TemplateDisplay> PostSave(TemplateDisplay display)
Parameters
Type |
Name |
Description |
TemplateDisplay |
display |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<TemplateDisplay> |
|