Use nullability on the rest of core

This commit is contained in:
Nikolaj Geisle
2022-02-16 16:03:53 +01:00
parent 093d336cc7
commit 6be2cd45db
224 changed files with 873 additions and 773 deletions

View File

@@ -7,11 +7,11 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// <summary>
/// The character to replace
/// </summary>
public string Char { get; set; }
public string Char { get; set; } = null!;
/// <summary>
/// The replacement character
/// </summary>
public string Replacement { get; set; }
public string Replacement { get; set; } = null!;
}
}

View File

@@ -31,6 +31,6 @@ namespace Umbraco.Cms.Core.Configuration
/// Gets the allowed addresses to retrieve data for the content dashboard.
/// </summary>
/// <value>The URLs.</value>
public string[] ContentDashboardUrlAllowlist { get; set; }
public string[]? ContentDashboardUrlAllowlist { get; set; }
}
}

View File

@@ -113,7 +113,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// <remarks>
/// If the value is a virtual path, it's resolved relative to the webroot.
/// </remarks>
public string UmbracoMediaPhysicalRootPath { get; set; }
public string UmbracoMediaPhysicalRootPath { get; set; } = null!;
/// <summary>
/// Gets or sets a value indicating whether to install the database when it is missing.

View File

@@ -6,6 +6,6 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// <summary>
/// Gets or sets the allowed addresses to retrieve data for the content dashboard.
/// </summary>
public string[] HelpPageUrlAllowList { get; set; }
public string[]? HelpPageUrlAllowList { get; set; }
}
}

View File

@@ -35,6 +35,6 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// <summary>
/// Gets or sets a value specifying the name of the site.
/// </summary>
public string SiteName { get; set; }
public string? SiteName { get; set; }
}
}

View File

@@ -85,18 +85,6 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// <summary>
/// Add additional character replacements, or override defaults
/// </summary>
public IEnumerable<Umbraco.Cms.Core.Configuration.Models.CharItem> UserDefinedCharCollection { get; set; }
[Obsolete("Use CharItem in the Umbraco.Cms.Core.Configuration.Models namespace instead. Scheduled for removal in V10.")]
public class CharItem : IChar
{
/// <inheritdoc/>
[Required]
public string Char { get; set; } = null!;
/// <inheritdoc/>
[Required]
public string Replacement { get; set; } = null!;
}
public IEnumerable<Umbraco.Cms.Core.Configuration.Models.CharItem>? UserDefinedCharCollection { get; set; }
}
}