Skip to content

Commit affb6d1

Browse files
committed
Updated docs to use GetMany vs GetAll
1 parent eeb06b0 commit affb6d1

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,20 @@ namespace Doccers.Core.Controllers.Api;
125125

126126
public class TagsController : UmbracoApiController
127127
{
128-
private readonly ICacheTagService _tagService;
128+
private readonly ICacheTagService _cacheTagService;
129129

130130
// Dependency injection rocks!
131-
public TagsController(ICacheTagService tagService)
131+
public TagsController(ICacheTagService cacheTagService)
132132
{
133-
_tagService = tagService;
133+
_cacheTagService = cacheTagService;
134134
}
135135

136136
[HttpGet]
137137
public IEnumerable<TagModel> GetDefaultTags()
138138
{
139139
// As mentioned earlier we want tags from "default"
140140
// group to be cached for a minute.
141-
return _tagService.GetAll("default", "defaultTags",
141+
return _cacheTagService.GetAll("default", "defaultTags",
142142
TimeSpan.FromMinutes(1));
143143
}
144144

@@ -148,7 +148,7 @@ public class TagsController : UmbracoApiController
148148
// If you don't specify a TimeSpan the object(s)
149149
// will be cached until manually removed or
150150
// if the site restarts.
151-
return _tagService.GetAll("blog", "blogTags");
151+
return _cacheTagService.GetAll("blog", "blogTags");
152152
}
153153
}
154154
```

15/umbraco-cms/reference/management/using-services/contenttypeservice.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Although the use of a GUID is preferable, you can also use it's numeric ID:
2222

2323
```csharp
2424
// Get a reference to the content type by its numeric ID
25-
IContentType contentType = _contentTypeService.Get(1234);
25+
IContentType contentType = _contentTypeService.Get(1234);
2626
```
2727

2828
Finally, you can also look up a content type by its alias:
@@ -41,19 +41,18 @@ As content types are stored in a hierarchical list with folders (containers), th
4141
IEnumerable<IContentType> contentTypes = _contentTypeService.GetAll();
4242
```
4343

44-
In the example above, the method was called without any parameters. The method also has two overloads, which lets you look up a collection fo content types by either specifying their GUID or numeric IDs:
45-
44+
The service also have `GetMany`-methods to get a collection of content types by their GUIDs IDs or numeric IDs:
4645
```csharp
4746
// Get a collection of two specific content types by their GUIDs IDs
48-
IEnumerable<IContentType> contentTypes = _contentTypeService.GetAll(new[] {
47+
IEnumerable<IContentType> contentTypes = _contentTypeService.GetMany(new[] {
4948
new Guid("2b54088e-d355-4b9e-aa4b-5aec4b3f87eb"),
5049
new Guid("859c5916-19d8-4a72-9bd0-5641ad503aa9")
5150
});
5251
```
5352

5453
```csharp
5554
// Get a collection of two specific content types by their numeric IDs
56-
IEnumerable<IContentType> contentTypes = _contentTypeService.GetAll(1234, 1235);
55+
IEnumerable<IContentType> contentTypes = _contentTypeService.GetMany(1234, 1235);
5756
```
5857

5958
To get a list of all Content Types of another content type, you can use the `GetChildren` method. This can be done by specifying the numeric ID or the GUID:

0 commit comments

Comments
 (0)