From f54de87ca2c7a43c4b0101f7f0fe218053864002 Mon Sep 17 00:00:00 2001 From: OlgunR Date: Wed, 22 Apr 2026 09:25:03 +0200 Subject: [PATCH] Standardize string property initialization to string.Empty Replaced String.Empty and null! with string.Empty for string properties in CatalogReadDto, CatalogWriteDto, and VwmyCatalog classes. This ensures consistent initialization and helps prevent null reference issues across the codebase. --- DbFirst.Application/Catalogs/CatalogReadDto.cs | 6 +++--- DbFirst.Application/Catalogs/CatalogWriteDto.cs | 4 ++-- DbFirst.BlazorWebApp/Models/CatalogReadDto.cs | 6 +++--- DbFirst.Domain/Entities/VwmyCatalog.cs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/DbFirst.Application/Catalogs/CatalogReadDto.cs b/DbFirst.Application/Catalogs/CatalogReadDto.cs index 260e0da..5030170 100644 --- a/DbFirst.Application/Catalogs/CatalogReadDto.cs +++ b/DbFirst.Application/Catalogs/CatalogReadDto.cs @@ -3,9 +3,9 @@ namespace DbFirst.Application.Catalogs; public class CatalogReadDto { public int Guid { get; set; } - public string CatTitle { get; set; } = String.Empty; - public string CatString { get; set; } = String.Empty; - public string AddedWho { get; set; } = String.Empty; + public string CatTitle { get; set; } = string.Empty; + public string CatString { get; set; } = string.Empty; + public string AddedWho { get; set; } = string.Empty; public DateTime AddedWhen { get; set; } public string? ChangedWho { get; set; } public DateTime? ChangedWhen { get; set; } diff --git a/DbFirst.Application/Catalogs/CatalogWriteDto.cs b/DbFirst.Application/Catalogs/CatalogWriteDto.cs index c95e39c..0d92af9 100644 --- a/DbFirst.Application/Catalogs/CatalogWriteDto.cs +++ b/DbFirst.Application/Catalogs/CatalogWriteDto.cs @@ -4,7 +4,7 @@ namespace DbFirst.Application.Catalogs; public class CatalogWriteDto { - public string CatTitle { get; set; } = null!; - public string CatString { get; set; } = null!; + public string CatTitle { get; set; } = string.Empty; + public string CatString { get; set; } = string.Empty; public CatalogUpdateProcedure UpdateProcedure { get; set; } = CatalogUpdateProcedure.Update; } diff --git a/DbFirst.BlazorWebApp/Models/CatalogReadDto.cs b/DbFirst.BlazorWebApp/Models/CatalogReadDto.cs index f930e2e..055ed95 100644 --- a/DbFirst.BlazorWebApp/Models/CatalogReadDto.cs +++ b/DbFirst.BlazorWebApp/Models/CatalogReadDto.cs @@ -3,9 +3,9 @@ namespace DbFirst.BlazorWebApp.Models; public class CatalogReadDto { public int Guid { get; set; } - public string CatTitle { get; set; } = null!; - public string CatString { get; set; } = null!; - public string AddedWho { get; set; } = null!; + public string CatTitle { get; set; } = string.Empty; + public string CatString { get; set; } = string.Empty; + public string AddedWho { get; set; } = string.Empty; public DateTime AddedWhen { get; set; } public string? ChangedWho { get; set; } public DateTime? ChangedWhen { get; set; } diff --git a/DbFirst.Domain/Entities/VwmyCatalog.cs b/DbFirst.Domain/Entities/VwmyCatalog.cs index a594711..f9603ad 100644 --- a/DbFirst.Domain/Entities/VwmyCatalog.cs +++ b/DbFirst.Domain/Entities/VwmyCatalog.cs @@ -4,11 +4,11 @@ public partial class VwmyCatalog { public int Guid { get; set; } - public string CatTitle { get; set; } = String.Empty; + public string CatTitle { get; set; } = string.Empty; - public string CatString { get; set; } = String.Empty; + public string CatString { get; set; } = string.Empty; - public string AddedWho { get; set; } = String.Empty; + public string AddedWho { get; set; } = string.Empty; public DateTime AddedWhen { get; set; }