From 8a25cc72bc53a5935f477b0d632caa81ce868591 Mon Sep 17 00:00:00 2001 From: Joe Glombek Date: Tue, 22 Oct 2024 10:34:17 +0100 Subject: [PATCH] Correct usage of GetModelPropertyType and GetModelContentType methods --- .../templating/modelsbuilder/understand-and-extend.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/13/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md b/13/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md index 63f6d2220a9..ff55fbf8024 100644 --- a/13/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md +++ b/13/umbraco-cms/reference/templating/modelsbuilder/understand-and-extend.md @@ -45,8 +45,10 @@ public partial class TextPage : PublishedContentModel 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: ```csharp -var contentType = TextPage.GetModelContentType(); // is a PublishedContentType -var propertyType = TextPage.GetModelPropertyType(x => x.Header); // is a PublishedPropertyType +var contentType = TextPage.GetModelContentType(_publishedSnapshotAccessor); // is a PublishedContentType +var propertyType = TextPage.GetModelPropertyType(_publishedSnapshotAccessor, x => x.Header); // is a PublishedPropertyType + +// Where _publishedSnapshotAccessor is an injected IPublishedSnapshotAccessor service ``` ## Composition and Inheritance