Skip to content

Commit 7843743

Browse files
committed
Document new option to disable virtual properties
1 parent ad022c5 commit 7843743

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

17/umbraco-cms/reference/configuration/modelsbuildersettings.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ This section allows you to configure the Umbraco models builder, a complete sect
1616
"ModelsDirectory": "~/umbraco/models",
1717
"AcceptUnsafeModelsDirectory": false,
1818
"DebugLevel": 0,
19-
"IncludeVersionNumberInGeneratedModels": true
19+
"IncludeVersionNumberInGeneratedModels": true,
20+
"GenerateVirtualProperties": true
2021
}
2122
}
2223
}
@@ -71,4 +72,14 @@ This setting specifies the logging level for the models builder. By default this
7172

7273
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.
7374

74-
If you prefer to exclude this version number from being written to the generated code, set this value to `false`.
75+
If you prefer to exclude this version number from being written to the generated code, set this value to `false`.
76+
77+
## Generate virtual properties
78+
79+
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`.
80+
81+
{% hint style="info" %}
82+
[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.
83+
84+
If you plan to use Hot Reload while developing your Umbraco site, set this setting to `false`.
85+
{% endhint %}

0 commit comments

Comments
 (0)