File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -252,18 +252,19 @@ The example below creates a `UmbracoApiController` to be able to fetch and inser
252252``` csharp
253253using Microsoft .AspNetCore .Mvc ;
254254using Umbraco .Cms .Persistence .EFCore .Scoping ;
255- using Umbraco .Cms .Web .Common .Controllers ;
256255
257256namespace Umbraco .Demo ;
258257
259- public class BlogCommentsController : UmbracoApiController
258+ [ApiController ]
259+ [Route (" /umbraco/api/blogcomments" )]
260+ public class BlogCommentsController : Controller
260261{
261262 private readonly IEFCoreScopeProvider <BlogContext > _efCoreScopeProvider ;
262263
263264 public BlogCommentsController (IEFCoreScopeProvider <BlogContext > efCoreScopeProvider )
264265 => _efCoreScopeProvider = efCoreScopeProvider ;
265266
266- [HttpGet ]
267+ [HttpGet ( " all " ) ]
267268 public async Task <IActionResult > All ()
268269 {
269270 using IEfCoreScope <BlogContext > scope = _efCoreScopeProvider .CreateScope ();
@@ -272,7 +273,7 @@ public class BlogCommentsController : UmbracoApiController
272273 return Ok (comments );
273274 }
274275
275- [HttpGet ]
276+ [HttpGet ( " getcomments " ) ]
276277 public async Task <IActionResult > GetComments (Guid umbracoNodeKey )
277278 {
278279 using IEfCoreScope <BlogContext > scope = _efCoreScopeProvider .CreateScope ();
@@ -285,7 +286,7 @@ public class BlogCommentsController : UmbracoApiController
285286 return Ok (comments );
286287 }
287288
288- [HttpPost ]
289+ [HttpPost ( " insertcomment " ) ]
289290 public async Task InsertComment (BlogComment comment )
290291 {
291292 using IEfCoreScope <BlogContext > scope = _efCoreScopeProvider .CreateScope ();
You can’t perform that action at this time.
0 commit comments