File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
14/umbraco-cms/fundamentals/code/debugging Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,12 @@ The example below uses UmbracoApiController which is obsolete in Umbraco 14 and
6363``` csharp
6464using Microsoft .AspNetCore .Mvc ;
6565using Microsoft .Extensions .Logging ;
66- using Umbraco .Cms .Web .Common .Controllers ;
6766
6867namespace 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 );
You can’t perform that action at this time.
0 commit comments