Skip to content

Commit ec41bb5

Browse files
authored
Fix code formatting
1 parent f42b6e4 commit ec41bb5

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

15/umbraco-ui-builder/advanced/events.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ builder.CreateUmbracoBuilder()
4040
Raised when the repository `Save` method is called and before the entity has been persisted. The notification contains an `Entity` property with `Before` and `After` inner properties. These properties provide access to a copy of the currently persisted entity (or null if a new entity) and the updated entity that´s saved.
4141
Changes can be made to the `After` entity and they will be persisted as part of the save operation. If the `Cancel` property of the notification is set to `true` then the save operation will be canceled and no changes will be saved.
4242

43-
````csharp
43+
```csharp
4444
// Example
4545
public class MyEntitySavingEventHandler : INotificationHandler<EntitySavingNotification> {
4646

@@ -72,7 +72,7 @@ public class MyEntitySavedEventHandler : INotificationHandler<EntitySavedNotifi
7272
}
7373

7474
}
75-
````
75+
```
7676

7777
### **EntityDeletingNotification**
7878

@@ -97,7 +97,7 @@ public class MyEntityDeletingEventHandler : INotificationHandler<EntityDeleting
9797

9898
Raised when the repository `Delete` method is called and **after** the entity has been deleted. The notification contains an `Entity` property providing access to a copy of the entity that´s deleted.
9999

100-
````csharp
100+
```csharp
101101
// Example
102102
public class MyEntityDeletedEventHandler : INotificationHandler<EntityDeletedNotification> {
103103

@@ -110,13 +110,13 @@ public class MyEntityDeletedEventHandler : INotificationHandler<EntityDeletedNo
110110
}
111111

112112
}
113-
````
113+
```
114114

115115
### **SqlQueryBuildingNotification**
116116

117117
Raised when the repository is **preparing** a SQL query. The notification contains the collection alias + type, the NPoco `Sql<ISqlContext>` object, and the where clause/order by clauses. These will be used to generate the SQL query.
118118

119-
````csharp
119+
```csharp
120120
// Example
121121
public class MySqlQueryBuildingEventHandler : INotificationHandler<SqlQueryBuildingNotification> {
122122

@@ -126,13 +126,13 @@ public class MySqlQueryBuildingEventHandler : INotificationHandler<SqlQueryBuil
126126
}
127127

128128
}
129-
````
129+
```
130130

131131
### **SqlQueryBuiltNotification**
132132

133133
Raised when the repository has **repaired** a SQL query. The notification contains the collection alias + type, the NPoco `Sql<ISqlContext>` object and the where clause/order by clauses that was used to generate the SQL query.
134134

135-
````csharp
135+
```csharp
136136
// Example
137137
public class MySqlQueryBuiltEventHandler : INotificationHandler<SqlQueryBuiltNotification> {
138138

@@ -142,13 +142,13 @@ public class MySqlQueryBuiltEventHandler : INotificationHandler<SqlQueryBuiltNo
142142
}
143143

144144
}
145-
````
145+
```
146146

147147
## Repository events validation
148148

149149
Starting with version `15.1.0`, complex server-side validation can be added to a collection by calling the `CancelOperation` method of the notification.
150150

151-
````csharp
151+
```csharp
152152
// Example
153153
public class MyEntitySavingEventHandler : INotificationHandler<EntitySavingNotification> {
154154

@@ -161,3 +161,4 @@ public class MyEntitySavingEventHandler : INotificationHandler<EntitySavingNoti
161161
}
162162

163163
}
164+
```

0 commit comments

Comments
 (0)