Updates to Core.Configuration Models to use DefaultValue attribute to allow auto generated JSONSchema to give a default value in schema

This commit is contained in:
Warren Buckley
2021-07-05 14:27:49 +01:00
parent cd36d050c5
commit 6b73ea767f
28 changed files with 372 additions and 106 deletions

View File

@@ -1,6 +1,8 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System.ComponentModel;
namespace Umbraco.Cms.Core.Configuration.Models
{
/// <summary>
@@ -9,14 +11,19 @@ namespace Umbraco.Cms.Core.Configuration.Models
[UmbracoOptions(Constants.Configuration.ConfigCoreDebug)]
public class CoreDebugSettings
{
internal const bool StaticLogIncompletedScopes = false;
internal const bool StaticDumpOnTimeoutThreadAbort = false;
/// <summary>
/// Gets or sets a value indicating whether incompleted scopes should be logged.
/// </summary>
public bool LogIncompletedScopes { get; set; } = false;
[DefaultValue(StaticLogIncompletedScopes)]
public bool LogIncompletedScopes { get; set; } = StaticLogIncompletedScopes;
/// <summary>
/// Gets or sets a value indicating whether memory dumps on thread abort should be taken.
/// </summary>
public bool DumpOnTimeoutThreadAbort { get; set; } = false;
[DefaultValue(StaticDumpOnTimeoutThreadAbort)]
public bool DumpOnTimeoutThreadAbort { get; set; } = StaticDumpOnTimeoutThreadAbort;
}
}