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>
@@ -8,6 +10,8 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// </summary>
public class ContentNotificationSettings
{
internal const bool StaticDisableHtmlEmail = false;
/// <summary>
/// Gets or sets a value for the email address for notifications.
/// </summary>
@@ -16,6 +20,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// <summary>
/// Gets or sets a value indicating whether HTML email notifications should be disabled.
/// </summary>
public bool DisableHtmlEmail { get; set; } = false;
[DefaultValue(StaticDisableHtmlEmail)]
public bool DisableHtmlEmail { get; set; } = StaticDisableHtmlEmail;
}
}