File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
15/umbraco-cms/reference/querying Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -18,21 +18,17 @@ After this you can use `_tagQuery` to access the `ITagQuery`.
1818
1919If you're using it in controllers, you can inject it into the constructor like so:
2020
21- {% hint style="warning" %}
22- The example below uses UmbracoApiController which is obsolete in Umbraco 14 and will be removed in Umbraco 15.
23- {% endhint %}
24-
2521``` csharp
2622using System .Collections .Generic ;
2723using System .Linq ;
2824using Microsoft .AspNetCore .Mvc ;
2925using Umbraco .Cms .Core .PublishedCache ;
30- using Umbraco .Cms .Web .Common .Controllers ;
3126
3227namespace UmbracoHelperDocs .Controllers ;
3328
34- [Route (" tags/[action]" )]
35- public class TagApiController : UmbracoApiController
29+ [ApiController ]
30+ [Route (" /umbraco/api/tags" )]
31+ public class TagApiController : Controller
3632{
3733 private readonly ITagQuery _tagQuery ;
3834
@@ -41,6 +37,7 @@ public class TagApiController : UmbracoApiController
4137 _tagQuery = tagQuery ;
4238 }
4339
40+ [HttpGet (" getmediatags" )]
4441 public ActionResult <IEnumerable <string >> GetMediaTags ()
4542 {
4643 return _tagQuery .GetAllMediaTags ().Select (tag => tag .Text ).ToList ();
You can’t perform that action at this time.
0 commit comments