diff --git a/14/umbraco-cms/reference/using-ioc.md b/14/umbraco-cms/reference/using-ioc.md index 4bb48fa31ad..dc7309f89b3 100644 --- a/14/umbraco-cms/reference/using-ioc.md +++ b/14/umbraco-cms/reference/using-ioc.md @@ -223,19 +223,17 @@ Once you have registered the dependencies inject them into your project where ne If you need to inject your service into a controller or another service, you will do so through the class. -{% hint style="warning" %} -The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15. -{% endhint %} - {% code title="FooController.cs" %} ```csharp using IOCDocs.Services; -using Umbraco.Cms.Web.Common.Controllers; +using Microsoft.AspNetCore.Mvc; namespace IOCDocs.Controllers; -public class FooController : UmbracoApiController +[ApiController] +[Route("/umbraco/api/foo")] +public class FooController : Controller { private readonly IFooBar _fooBar; @@ -244,6 +242,7 @@ public class FooController : UmbracoApiController _fooBar = fooBar; } + [HttpGet("foo")] public string Foo() { var bar = _fooBar.Foo(); diff --git a/15/umbraco-cms/reference/using-ioc.md b/15/umbraco-cms/reference/using-ioc.md index 4bb48fa31ad..dc7309f89b3 100644 --- a/15/umbraco-cms/reference/using-ioc.md +++ b/15/umbraco-cms/reference/using-ioc.md @@ -223,19 +223,17 @@ Once you have registered the dependencies inject them into your project where ne If you need to inject your service into a controller or another service, you will do so through the class. -{% hint style="warning" %} -The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15. -{% endhint %} - {% code title="FooController.cs" %} ```csharp using IOCDocs.Services; -using Umbraco.Cms.Web.Common.Controllers; +using Microsoft.AspNetCore.Mvc; namespace IOCDocs.Controllers; -public class FooController : UmbracoApiController +[ApiController] +[Route("/umbraco/api/foo")] +public class FooController : Controller { private readonly IFooBar _fooBar; @@ -244,6 +242,7 @@ public class FooController : UmbracoApiController _fooBar = fooBar; } + [HttpGet("foo")] public string Foo() { var bar = _fooBar.Foo();