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:
@@ -88,9 +88,9 @@ namespace DbFirst.BlazorWebApp.Services
|
||||
Dictionary<string, ColumnDefinition> columnLookup)
|
||||
{
|
||||
layout ??= new BandLayout();
|
||||
layout.Bands ??= new List<BandDefinition>();
|
||||
layout.ColumnOrder ??= new List<string>();
|
||||
layout.ColumnWidths ??= new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);
|
||||
layout.Bands ??= [];
|
||||
layout.ColumnOrder ??= [];
|
||||
layout.ColumnWidths ??= [];
|
||||
|
||||
foreach (var band in layout.Bands)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user