Makes model props readonly/immutable

This commit is contained in:
Shannon
2020-02-03 18:37:07 +11:00
parent 9f0becaf52
commit 199ea404ed
2 changed files with 4 additions and 8 deletions

View File

@@ -21,13 +21,13 @@ namespace Umbraco.Core.Models.Blocks
/// The Id of the data item
/// </summary>
[DataMember(Name = "udi")]
public Udi Udi { get; set; }
public Udi Udi { get; }
/// <summary>
/// The settings for the layout item
/// </summary>
[DataMember(Name = "settings")]
public IPublishedElement Settings { get; set; }
public IPublishedElement Settings { get; }
/// <summary>
/// The data item referenced
@@ -36,6 +36,6 @@ namespace Umbraco.Core.Models.Blocks
/// This is ignored from serialization since it is just a reference to the actual data element
/// </remarks>
[IgnoreDataMember]
public IPublishedElement Data { get; set; }
public IPublishedElement Data { get; }
}
}

View File

@@ -16,15 +16,11 @@ namespace Umbraco.Core.Models.Blocks
Layout = layout;
}
public BlockListModel()
{
}
/// <summary>
/// The layout items of the Block List editor
/// </summary>
[DataMember(Name = "layout")]
public IEnumerable<BlockListLayoutReference> Layout { get; set; }
public IEnumerable<BlockListLayoutReference> Layout { get; }
}