diff --git a/10/umbraco-cms/reference/cache/examples/tags.md b/10/umbraco-cms/reference/cache/examples/tags.md index 4c5b7750fbf..39cd973340b 100644 --- a/10/umbraco-cms/reference/cache/examples/tags.md +++ b/10/umbraco-cms/reference/cache/examples/tags.md @@ -18,7 +18,7 @@ For this example we're working with tags. On my site I have two tag properties: We're going to expose an endpoint that allows us to get the tags from each group. -The tags from the `default` should be cached for a minute and the `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice. +The tags from the `default` should be cached for a minute. The `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice. ## Example diff --git a/13/umbraco-cms/reference/cache/examples/tags.md b/13/umbraco-cms/reference/cache/examples/tags.md index e91884ee88b..05585a8c864 100644 --- a/13/umbraco-cms/reference/cache/examples/tags.md +++ b/13/umbraco-cms/reference/cache/examples/tags.md @@ -16,7 +16,7 @@ For this example we're working with tags. On my site I have two tag properties: We're going to expose an endpoint that allows us to get the tags from each group. -The tags from the `default` should be cached for a minute and the `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice. +The tags from the `default` should be cached for a minute. The `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice. ## Example diff --git a/14/umbraco-cms/reference/cache/examples/tags.md b/14/umbraco-cms/reference/cache/examples/tags.md index 5369fac4fed..5b374b4486b 100644 --- a/14/umbraco-cms/reference/cache/examples/tags.md +++ b/14/umbraco-cms/reference/cache/examples/tags.md @@ -16,7 +16,7 @@ For this example we're working with tags. On my site I have two tag properties: We're going to expose an endpoint that allows us to get the tags from each group. -The tags from the `default` should be cached for a minute and the `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice. +The tags from the `default` should be cached for a minute. The `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice. ## Example @@ -108,22 +108,18 @@ Now you can inject `ICacheTagService` in any constructor in your project - wohoo Now that we have our service it's time to create an endpoint where we can fetch the (cached) tags. -{% hint style="warning" %} -The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15. -{% endhint %} - ```csharp using System; using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Doccers.Core.Services; using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Web.Common.Controllers; - namespace Doccers.Core.Controllers.Api; -public class TagsController : UmbracoApiController +[ApiController] +[Route("/umbraco/api/tags")] +public class TagsController : Controller { private readonly ICacheTagService _tagService; @@ -133,7 +129,7 @@ public class TagsController : UmbracoApiController _tagService = tagService; } - [HttpGet] + [HttpGet("getdefaulttags")] public IEnumerable GetDefaultTags() { // As mentioned earlier we want tags from "default" @@ -142,7 +138,7 @@ public class TagsController : UmbracoApiController TimeSpan.FromMinutes(1)); } - [HttpGet] + [HttpGet("getblogtags")] public IEnumerable GetBlogTags() { // If you don't specify a TimeSpan the object(s) diff --git a/15/umbraco-cms/reference/cache/examples/tags.md b/15/umbraco-cms/reference/cache/examples/tags.md index 5369fac4fed..5b374b4486b 100644 --- a/15/umbraco-cms/reference/cache/examples/tags.md +++ b/15/umbraco-cms/reference/cache/examples/tags.md @@ -16,7 +16,7 @@ For this example we're working with tags. On my site I have two tag properties: We're going to expose an endpoint that allows us to get the tags from each group. -The tags from the `default` should be cached for a minute and the `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice. +The tags from the `default` should be cached for a minute. The `blog` tags will be cached until site restart or if you publish a blog post node in the Backoffice. ## Example @@ -108,22 +108,18 @@ Now you can inject `ICacheTagService` in any constructor in your project - wohoo Now that we have our service it's time to create an endpoint where we can fetch the (cached) tags. -{% hint style="warning" %} -The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15. -{% endhint %} - ```csharp using System; using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; using Doccers.Core.Services; using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Web.Common.Controllers; - namespace Doccers.Core.Controllers.Api; -public class TagsController : UmbracoApiController +[ApiController] +[Route("/umbraco/api/tags")] +public class TagsController : Controller { private readonly ICacheTagService _tagService; @@ -133,7 +129,7 @@ public class TagsController : UmbracoApiController _tagService = tagService; } - [HttpGet] + [HttpGet("getdefaulttags")] public IEnumerable GetDefaultTags() { // As mentioned earlier we want tags from "default" @@ -142,7 +138,7 @@ public class TagsController : UmbracoApiController TimeSpan.FromMinutes(1)); } - [HttpGet] + [HttpGet("getblogtags")] public IEnumerable GetBlogTags() { // If you don't specify a TimeSpan the object(s)