Skip to content

Commit b8881ee

Browse files
Update controller
1 parent 1111440 commit b8881ee

File tree

1 file changed

+4
-3
lines changed
  • 14/umbraco-cms/fundamentals/code/debugging

1 file changed

+4
-3
lines changed

14/umbraco-cms/fundamentals/code/debugging/logging.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ The example below uses UmbracoApiController which is obsolete in Umbraco 14 and
6363
```csharp
6464
using Microsoft.AspNetCore.Mvc;
6565
using Microsoft.Extensions.Logging;
66-
using Umbraco.Cms.Web.Common.Controllers;
6766

6867
namespace Umbraco.Cms.Web.UI.NetCore;
6968

70-
public class MyApiController : UmbracoApiController
69+
[ApiController]
70+
[Route("/umbraco/api/myapi")]
71+
public class MyApiController : Controller
7172
{
7273
private readonly ILogger<MyApiController> _logger;
7374

@@ -77,7 +78,7 @@ public class MyApiController : UmbracoApiController
7778
}
7879

7980
/// /umbraco/api/MyApi/SayHello?name=John
80-
[HttpGet]
81+
[HttpGet("sayhello")]
8182
public string SayHello(string name)
8283
{
8384
_logger.LogInformation("We are saying hello to {Name}", name);

0 commit comments

Comments
 (0)