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:
@@ -33,7 +33,7 @@ public class MassDataApiClient : IMassDataApiClient
|
||||
|
||||
var url = query.Count == 0 ? Endpoint : $"{Endpoint}?{string.Join("&", query)}";
|
||||
var result = await _httpClient.GetFromJsonAsync<List<MassDataReadDto>>(url, ct);
|
||||
return result ?? new List<MassDataReadDto>();
|
||||
return result ?? [];
|
||||
}
|
||||
|
||||
public async Task<ApiResult<MassDataReadDto?>> UpsertAsync(MassDataWriteDto dto, CancellationToken ct = default)
|
||||
|
||||
Reference in New Issue
Block a user