Adopt C# 12 collection expressions for empty lists/dicts
Refactored code to use C# 12 collection expressions ([]) for initializing empty lists and dictionaries instead of the older constructors. This change modernizes and simplifies collection initialization across models, services, and API clients without altering any logic.
This commit is contained in:
@@ -4,8 +4,8 @@ namespace DbFirst.BlazorWebApp.Models.Grid
|
||||
{
|
||||
public class BandLayout
|
||||
{
|
||||
public List<BandDefinition> Bands { get; set; } = new();
|
||||
public List<string> ColumnOrder { get; set; } = new();
|
||||
public List<BandDefinition> Bands { get; set; } = [];
|
||||
public List<string> ColumnOrder { get; set; } = [];
|
||||
public Dictionary<string, string?> ColumnWidths { get; set; } = new(StringComparer.OrdinalIgnoreCase);
|
||||
public GridPersistentLayout? GridLayout { get; set; }
|
||||
public SizeMode SizeMode { get; set; } = SizeMode.Medium;
|
||||
@@ -15,7 +15,7 @@ namespace DbFirst.BlazorWebApp.Models.Grid
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
public string Caption { get; set; } = string.Empty;
|
||||
public List<string> Columns { get; set; } = new();
|
||||
public List<string> Columns { get; set; } = [];
|
||||
}
|
||||
|
||||
public class BandOption
|
||||
|
||||
Reference in New Issue
Block a user