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:
OlgunR
2026-04-20 14:33:08 +02:00
parent fcbc66f8f5
commit 0c936d0bf9
6 changed files with 10 additions and 10 deletions

View File

@@ -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