Description
Two different mappers assign different defaults when StartupType is null:
ServiceRepository.MapToDomain (src/Servy.Infrastructure/Data/ServiceRepository.cs, line 632):
StartupType = dto.StartupType.HasValue ? (ServiceStartType)dto.StartupType.Value : ServiceStartType.Manual,
ServiceMapper.ToDomain (src/Servy.Core/Mappers/ServiceMapper.cs, line 101):
StartupType = dto.StartupType == null ? ServiceStartType.Automatic : (ServiceStartType)dto.StartupType,
Both methods map ServiceDto → domain Service, but one defaults to Manual and the other to Automatic. The behavior depends on which code path is taken.
Severity
Warning — inconsistent behavior depending on code path.
Suggested fix
Align both mappers to the same default value and consider extracting the default to a shared constant.
Description
Two different mappers assign different defaults when
StartupTypeis null:ServiceRepository.MapToDomain (
src/Servy.Infrastructure/Data/ServiceRepository.cs, line 632):ServiceMapper.ToDomain (
src/Servy.Core/Mappers/ServiceMapper.cs, line 101):Both methods map
ServiceDto→ domainService, but one defaults toManualand the other toAutomatic. The behavior depends on which code path is taken.Severity
Warning — inconsistent behavior depending on code path.
Suggested fix
Align both mappers to the same default value and consider extracting the default to a shared constant.