You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 13/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,8 +45,10 @@ public partial class TextPage : PublishedContentModel
45
45
What is important is the `Header` property. The rest is (a) a constructor and (b) some static helpers to get the `PublishedContentType` and the `PublishedPropertyType` objects:
46
46
47
47
```csharp
48
-
varcontentType=TextPage.GetModelContentType(); // is a PublishedContentType
49
-
varpropertyType=TextPage.GetModelPropertyType(x=>x.Header); // is a PublishedPropertyType
48
+
varcontentType=TextPage.GetModelContentType(_publishedSnapshotAccessor); // is a PublishedContentType
49
+
varpropertyType=TextPage.GetModelPropertyType(_publishedSnapshotAccessor, x=>x.Header); // is a PublishedPropertyType
50
+
51
+
// Where _publishedSnapshotAccessor is an injected IPublishedSnapshotAccessor service
0 commit comments