diff --git a/14/umbraco-cms/tutorials/getting-started-with-entity-framework-core.md b/14/umbraco-cms/tutorials/getting-started-with-entity-framework-core.md index 6b5665bbef2..003ead1fb76 100644 --- a/14/umbraco-cms/tutorials/getting-started-with-entity-framework-core.md +++ b/14/umbraco-cms/tutorials/getting-started-with-entity-framework-core.md @@ -245,25 +245,25 @@ The example below creates a `UmbracoApiController` to be able to fetch and inser {% hint style="warning" %} * This example uses the `BlogComment` class, which is a database model. The recommended approach would be to map these over to a ViewModel instead, that way your database & UI layers are not coupled. Be aware that things like error handling and data validation have been omitted for brevity. -* The example uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15. {% endhint %} ```csharp using Microsoft.AspNetCore.Mvc; using Umbraco.Cms.Persistence.EFCore.Scoping; -using Umbraco.Cms.Web.Common.Controllers; namespace Umbraco.Demo; -public class BlogCommentsController : UmbracoApiController +[ApiController] +[Route("/umbraco/api/blogcomments")] +public class BlogCommentsController : Controller { private readonly IEFCoreScopeProvider _efCoreScopeProvider; public BlogCommentsController(IEFCoreScopeProvider efCoreScopeProvider) => _efCoreScopeProvider = efCoreScopeProvider; - [HttpGet] + [HttpGet("all")] public async Task All() { using IEfCoreScope scope = _efCoreScopeProvider.CreateScope(); @@ -272,7 +272,7 @@ public class BlogCommentsController : UmbracoApiController return Ok(comments); } - [HttpGet] + [HttpGet("getcomments")] public async Task GetComments(Guid umbracoNodeKey) { using IEfCoreScope scope = _efCoreScopeProvider.CreateScope(); @@ -285,7 +285,7 @@ public class BlogCommentsController : UmbracoApiController return Ok(comments); } - [HttpPost] + [HttpPost("insertcomment")] public async Task InsertComment(BlogComment comment) { using IEfCoreScope scope = _efCoreScopeProvider.CreateScope(); diff --git a/15/umbraco-cms/tutorials/getting-started-with-entity-framework-core.md b/15/umbraco-cms/tutorials/getting-started-with-entity-framework-core.md index 6b5665bbef2..003ead1fb76 100644 --- a/15/umbraco-cms/tutorials/getting-started-with-entity-framework-core.md +++ b/15/umbraco-cms/tutorials/getting-started-with-entity-framework-core.md @@ -245,25 +245,25 @@ The example below creates a `UmbracoApiController` to be able to fetch and inser {% hint style="warning" %} * This example uses the `BlogComment` class, which is a database model. The recommended approach would be to map these over to a ViewModel instead, that way your database & UI layers are not coupled. Be aware that things like error handling and data validation have been omitted for brevity. -* The example uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15. {% endhint %} ```csharp using Microsoft.AspNetCore.Mvc; using Umbraco.Cms.Persistence.EFCore.Scoping; -using Umbraco.Cms.Web.Common.Controllers; namespace Umbraco.Demo; -public class BlogCommentsController : UmbracoApiController +[ApiController] +[Route("/umbraco/api/blogcomments")] +public class BlogCommentsController : Controller { private readonly IEFCoreScopeProvider _efCoreScopeProvider; public BlogCommentsController(IEFCoreScopeProvider efCoreScopeProvider) => _efCoreScopeProvider = efCoreScopeProvider; - [HttpGet] + [HttpGet("all")] public async Task All() { using IEfCoreScope scope = _efCoreScopeProvider.CreateScope(); @@ -272,7 +272,7 @@ public class BlogCommentsController : UmbracoApiController return Ok(comments); } - [HttpGet] + [HttpGet("getcomments")] public async Task GetComments(Guid umbracoNodeKey) { using IEfCoreScope scope = _efCoreScopeProvider.CreateScope(); @@ -285,7 +285,7 @@ public class BlogCommentsController : UmbracoApiController return Ok(comments); } - [HttpPost] + [HttpPost("insertcomment")] public async Task InsertComment(BlogComment comment) { using IEfCoreScope scope = _efCoreScopeProvider.CreateScope();