Porting old Umbraco API Controllers
Tips to porting over API controllers from Umbraco 13 and below
Porting over UmbracoApiController implementations
UmbracoApiController implementationsusing Microsoft.AspNetCore.Mvc;
namespace UmbracoDocs.Samples;
[ApiController]
[Route("/umbraco/api/products")]
public class ProductsController : Controller
{
[HttpGet("getall")]
public IActionResult GetAll() => Ok(new[] { "Table", "Chair", "Desk", "Computer" });
}using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Web.Common.Controllers;
namespace UmbracoDocs.Samples;
public class ProductsController : UmbracoApiController
{
public IActionResult GetAll() => Ok(new[] { "Table", "Chair", "Desk", "Computer" });
}Porting over "plugin based" implementations
Backoffice API Controllers
Last updated
Was this helpful?