Skip to content

Commit c1de33c

Browse files
Update v15
1 parent 4f06b8c commit c1de33c

File tree

1 file changed

+5
-9
lines changed
  • 15/umbraco-cms/reference/cache/examples

1 file changed

+5
-9
lines changed

15/umbraco-cms/reference/cache/examples/tags.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,18 @@ Now you can inject `ICacheTagService` in any constructor in your project - wohoo
108108

109109
Now that we have our service it's time to create an endpoint where we can fetch the (cached) tags.
110110

111-
{% hint style="warning" %}
112-
The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15.
113-
{% endhint %}
114-
115111
```csharp
116112
using System;
117113
using System.Collections.Generic;
118114
using Microsoft.AspNetCore.Mvc;
119115
using Doccers.Core.Services;
120116
using Umbraco.Cms.Core.Models;
121-
using Umbraco.Cms.Web.Common.Controllers;
122-
123117

124118
namespace Doccers.Core.Controllers.Api;
125119

126-
public class TagsController : UmbracoApiController
120+
[ApiController]
121+
[Route("/umbraco/api/tags")]
122+
public class TagsController : Controller
127123
{
128124
private readonly ICacheTagService _tagService;
129125

@@ -133,7 +129,7 @@ public class TagsController : UmbracoApiController
133129
_tagService = tagService;
134130
}
135131

136-
[HttpGet]
132+
[HttpGet("getdefaulttags")]
137133
public IEnumerable<TagModel> GetDefaultTags()
138134
{
139135
// As mentioned earlier we want tags from "default"
@@ -142,7 +138,7 @@ public class TagsController : UmbracoApiController
142138
TimeSpan.FromMinutes(1));
143139
}
144140

145-
[HttpGet]
141+
[HttpGet("getblogtags")]
146142
public IEnumerable<TagModel> GetBlogTags()
147143
{
148144
// If you don't specify a TimeSpan the object(s)

0 commit comments

Comments
 (0)