Skip to content

Commit 5e106d2

Browse files
authored
Merge pull request #7596 from umbraco/wip-note
Updated article as per syleguide
2 parents 60060ac + 8532a2f commit 5e106d2

File tree

3 files changed

+36
-38
lines changed

3 files changed

+36
-38
lines changed

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Relation Service
22

3-
The `RelationService` allows you to create relations between objects that would otherwise have no obvious connection.
3+
The `RelationService` allows creating relations between objects that would otherwise have no obvious connection.
44

5-
Below you will find examples using `RelationService`.
5+
The following examples demonstrate how to use `RelationService`.
66

77
## Automatically relate to the root node
88

9-
To perform the said task we need a Notification Handler:
9+
To perform this task, implement a Notification Handler:
1010

11-
[You can read more about composing Umbraco here](../../../implementation/composing.md)
11+
[Read more about composing Umbraco here](../../../implementation/composing.md).
1212

1313
```csharp
1414
using Umbraco.Cms.Core.Events;
@@ -43,7 +43,7 @@ public class ContentPublishedNotificationHandler(IContentService contentService,
4343
}
4444
```
4545

46-
To have Umbraco recognize our Notification Handler we need to register it in a composer:
46+
To make Umbraco recognize the Notification Handler, register it in a composer:
4747

4848
```csharp
4949
using Umbraco.Cms.Core.Composing;
@@ -60,11 +60,11 @@ public class RelationComposer : IComposer
6060
}
6161
```
6262

63-
If I now `Save and Publish` my `Products` node I get the following result:
63+
After saving and publishing the `Products` node, the following result is displayed:
6464

65-
![Relations](../../../../../10/umbraco-cms/reference/management/services/images/relations.PNG)
65+
![Relations](images/relations.PNG)
6666

67-
Now let us try and fetch the data from an API.
67+
The next step is to fetch the data from an API.
6868

6969
```csharp
7070
using Microsoft.AspNetCore.Mvc;
@@ -110,7 +110,7 @@ public class RelationsController : Controller
110110
}
111111
```
112112

113-
Notice the `x => new Relation()`? We need to make sure what we are returning can be serialized. Therefore the `Relation` class is:
113+
Note the `x => new Relation()` expression. The returned data must be serializable, therefore the `Relation` class is defined as follows:
114114

115115
```csharp
116116
[DataContract(Name = "relation")]
@@ -124,12 +124,10 @@ public class Relation
124124
}
125125
```
126126

127-
Browsing `/umbraco/api/relations/getbyrelationtypealias?alias=homesick` now returns the following:
127+
Browsing `/umbraco/api/relations/getbyrelationtypealias?alias=homesick` returns the following output:
128128

129-
![Relations](../../../../../10/umbraco-cms/reference/management/services/images/relations-api.PNG)
129+
![Relations](images/relations-api.PNG)
130130

131131
{% hint style="info" %}
132-
133-
If you want to do something similar it is recommended that you wrap a caching layer around it, as the RelationService queries the database directly.
134-
132+
When implementing similar functionality, consider wrapping a caching layer around it. The `RelationService` queries the database directly.
135133
{% endhint %}

16/umbraco-cms/reference/management/using-services/relationservice.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Relation Service
22

3-
The `RelationService` allows you to create relations between objects that would otherwise have no obvious connection.
3+
The `RelationService` allows creating relations between objects that would otherwise have no obvious connection.
44

5-
Below you will find examples using `RelationService`.
5+
The following examples demonstrate how to use `RelationService`.
66

77
## Automatically relate to the root node
88

9-
To perform the said task we need a Notification Handler:
9+
To perform this task, implement a Notification Handler:
1010

11-
[You can read more about composing Umbraco here](../../../implementation/composing.md)
11+
[Read more about composing Umbraco here](../../../implementation/composing.md).
1212

1313
```csharp
1414
using Umbraco.Cms.Core.Events;
@@ -43,7 +43,7 @@ public class ContentPublishedNotificationHandler(IContentService contentService,
4343
}
4444
```
4545

46-
To have Umbraco recognize our Notification Handler we need to register it in a composer:
46+
To make Umbraco recognize the Notification Handler, register it in a composer:
4747

4848
```csharp
4949
using Umbraco.Cms.Core.Composing;
@@ -60,11 +60,11 @@ public class RelationComposer : IComposer
6060
}
6161
```
6262

63-
If I now `Save and Publish` my `Products` node I get the following result:
63+
After saving and publishing the `Products` node, the following result is displayed:
6464

65-
![Relations](../../../../../17/umbraco-cms/reference/management/using-services/images/relations.PNG)
65+
![Relations](images/relations.PNG)
6666

67-
Now let us try and fetch the data from an API.
67+
The next step is to fetch the data from an API.
6868

6969
```csharp
7070
using Microsoft.AspNetCore.Mvc;
@@ -110,7 +110,7 @@ public class RelationsController : Controller
110110
}
111111
```
112112

113-
Notice the `x => new Relation()`? We need to make sure what we are returning can be serialized. Therefore the `Relation` class is:
113+
Note the `x => new Relation()` expression. The returned data must be serializable, therefore the `Relation` class is defined as follows:
114114

115115
```csharp
116116
[DataContract(Name = "relation")]
@@ -124,10 +124,10 @@ public class Relation
124124
}
125125
```
126126

127-
Browsing `/umbraco/api/relations/getbyrelationtypealias?alias=homesick` now returns the following:
127+
Browsing `/umbraco/api/relations/getbyrelationtypealias?alias=homesick` returns the following output:
128128

129-
![Relations](../../../../../17/umbraco-cms/reference/management/using-services/images/relations-api.PNG)
129+
![Relations](images/relations-api.PNG)
130130

131131
{% hint style="info" %}
132-
If you want to do something similar it is recommended that you wrap a caching layer around it, as the RelationService queries the database directly.
132+
When implementing similar functionality, consider wrapping a caching layer around it. The `RelationService` queries the database directly.
133133
{% endhint %}

17/umbraco-cms/reference/management/using-services/relationservice.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Relation Service
22

3-
The `RelationService` allows you to create relations between objects that would otherwise have no obvious connection.
3+
The `RelationService` allows creating relations between objects that would otherwise have no obvious connection.
44

5-
Below you will find examples using `RelationService`.
5+
The following examples demonstrate how to use `RelationService`.
66

77
## Automatically relate to the root node
88

9-
To perform the said task we need a Notification Handler:
9+
To perform this task, implement a Notification Handler:
1010

11-
[You can read more about composing Umbraco here](../../../implementation/composing.md)
11+
[Read more about composing Umbraco here](../../../implementation/composing.md).
1212

1313
```csharp
1414
using Umbraco.Cms.Core.Events;
@@ -43,7 +43,7 @@ public class ContentPublishedNotificationHandler(IContentService contentService,
4343
}
4444
```
4545

46-
To have Umbraco recognize our Notification Handler we need to register it in a composer:
46+
To make Umbraco recognize the Notification Handler, register it in a composer:
4747

4848
```csharp
4949
using Umbraco.Cms.Core.Composing;
@@ -60,11 +60,11 @@ public class RelationComposer : IComposer
6060
}
6161
```
6262

63-
If I now `Save and Publish` my `Products` node I get the following result:
63+
After saving and publishing the `Products` node, the following result is displayed:
6464

65-
![Relations](../../../../../16/umbraco-cms/reference/management/using-services/images/relations.PNG)
65+
![Relations](images/relations.PNG)
6666

67-
Now let us try and fetch the data from an API.
67+
The next step is to fetch the data from an API.
6868

6969
```csharp
7070
using Microsoft.AspNetCore.Mvc;
@@ -110,7 +110,7 @@ public class RelationsController : Controller
110110
}
111111
```
112112

113-
Notice the `x => new Relation()`? We need to make sure what we are returning can be serialized. Therefore the `Relation` class is:
113+
Note the `x => new Relation()` expression. The returned data must be serializable, therefore the `Relation` class is defined as follows:
114114

115115
```csharp
116116
[DataContract(Name = "relation")]
@@ -124,10 +124,10 @@ public class Relation
124124
}
125125
```
126126

127-
Browsing `/umbraco/api/relations/getbyrelationtypealias?alias=homesick` now returns the following:
127+
Browsing `/umbraco/api/relations/getbyrelationtypealias?alias=homesick` returns the following output:
128128

129-
![Relations](../../../../../16/umbraco-cms/reference/management/using-services/images/relations-api.PNG)
129+
![Relations](images/relations-api.PNG)
130130

131131
{% hint style="info" %}
132-
If you want to do something similar it is recommended that you wrap a caching layer around it, as the RelationService queries the database directly.
132+
When implementing similar functionality, consider wrapping a caching layer around it. The `RelationService` queries the database directly.
133133
{% endhint %}

0 commit comments

Comments
 (0)