Make lots of models nullable

This commit is contained in:
Nikolaj Geisle
2022-01-21 11:43:58 +01:00
parent b6d5465b49
commit 936dd38c55
278 changed files with 1379 additions and 1237 deletions

View File

@@ -19,10 +19,10 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
}
[DataMember(Name = "name", IsRequired = true)]
public string Name { get; set; }
public string? Name { get; set; }
[DataMember(Name = "displayName")]
public string DisplayName { get; set; }
public string? DisplayName { get; set; }
/// <summary>
/// Defines the tabs containing display properties
@@ -34,7 +34,7 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
/// Internal property used for tests to get all properties from all tabs
/// </summary>
[IgnoreDataMember]
IEnumerable<ContentPropertyDisplay> IContentProperties<ContentPropertyDisplay>.Properties => Tabs.SelectMany(x => x.Properties);
IEnumerable<ContentPropertyDisplay> IContentProperties<ContentPropertyDisplay>.Properties => Tabs.Where(x => x.Properties is not null).SelectMany(x => x.Properties!);
/// <summary>
/// The language/culture assigned to this content variation
@@ -43,10 +43,10 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
/// If this is null it means this content variant is an invariant culture
/// </remarks>
[DataMember(Name = "language")]
public Language Language { get; set; }
public Language? Language { get; set; }
[DataMember(Name = "segment")]
public string Segment { get; set; }
public string? Segment { get; set; }
[DataMember(Name = "state")]
public ContentSavedState State { get; set; }