From 7843743e7e477bb58edc7c0cc107ec4831ce9281 Mon Sep 17 00:00:00 2001 From: kjac Date: Tue, 7 Oct 2025 13:36:31 +0200 Subject: [PATCH 1/2] Document new option to disable virtual properties --- .../configuration/modelsbuildersettings.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/17/umbraco-cms/reference/configuration/modelsbuildersettings.md b/17/umbraco-cms/reference/configuration/modelsbuildersettings.md index 3b3fd62fc86..963edd54fd7 100644 --- a/17/umbraco-cms/reference/configuration/modelsbuildersettings.md +++ b/17/umbraco-cms/reference/configuration/modelsbuildersettings.md @@ -16,7 +16,8 @@ This section allows you to configure the Umbraco models builder, a complete sect "ModelsDirectory": "~/umbraco/models", "AcceptUnsafeModelsDirectory": false, "DebugLevel": 0, - "IncludeVersionNumberInGeneratedModels": true + "IncludeVersionNumberInGeneratedModels": true, + "GenerateVirtualProperties": true } } } @@ -71,4 +72,14 @@ This setting specifies the logging level for the models builder. By default this When source code options are used, the Umbraco version number written to the generated code for each property of the model. This can be useful for debugging purposes but isn't essential. It causes the generated code to change every time Umbraco is upgraded and models are regenerated. In turn, this leads unnecessary code file changes that need to be checked into source control. -If you prefer to exclude this version number from being written to the generated code, set this value to `false`. \ No newline at end of file +If you prefer to exclude this version number from being written to the generated code, set this value to `false`. + +## Generate virtual properties + +By default, the models will be generated with all properties marked as `virtual` for extensibility purposes. You can disable `virtual` properties by setting this to `false`. + +{% hint style="info" %} +[Hot Reload](https://learn.microsoft.com/en-us/aspnet/core/test/hot-reload) does not support changing or adding `virtual` properties while the application is running. + +If you plan to use Hot Reload while developing your Umbraco site, set this setting to `false`. +{% endhint %} From 391f0f681e78164c9b242c418acdd57a781f07ba Mon Sep 17 00:00:00 2001 From: Esha Noronha <82437098+eshanrnh@users.noreply.github.com> Date: Thu, 9 Oct 2025 09:51:54 +0200 Subject: [PATCH 2/2] Update 17/umbraco-cms/reference/configuration/modelsbuildersettings.md --- 17/umbraco-cms/reference/configuration/modelsbuildersettings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/17/umbraco-cms/reference/configuration/modelsbuildersettings.md b/17/umbraco-cms/reference/configuration/modelsbuildersettings.md index 963edd54fd7..0e56c19eaa1 100644 --- a/17/umbraco-cms/reference/configuration/modelsbuildersettings.md +++ b/17/umbraco-cms/reference/configuration/modelsbuildersettings.md @@ -81,5 +81,5 @@ By default, the models will be generated with all properties marked as `virtual` {% hint style="info" %} [Hot Reload](https://learn.microsoft.com/en-us/aspnet/core/test/hot-reload) does not support changing or adding `virtual` properties while the application is running. -If you plan to use Hot Reload while developing your Umbraco site, set this setting to `false`. +If you plan to use Hot Reload while developing your Umbraco site, set this value to `false`. {% endhint %}