Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 8 #1823

Merged
merged 3 commits into from
May 26, 2024
Merged

.NET 8 #1823

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<LangVersion>11.0</LangVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<RuntimeIdentifiers>linux-x64;win-x64;osx-arm64</RuntimeIdentifiers>
<SatelliteResourceLanguages>none</SatelliteResourceLanguages>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Many build warnings for missing docstrings when enabling this - we may want to fix and enable per-project where needed instead? -->
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.401",
"version": "8.0.300",
"rollForward": "minor"
}
}
1 change: 1 addition & 0 deletions news/1823-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump to .NET 8.0 and C# 12
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace Microservices.IdentifierMapper.Messaging
/// <summary>
/// Exception thrown when the PatientID tag of a dicom file contains invalid/corrupt data
/// </summary>
[Serializable]
public class BadPatientIDException : Exception
{
public BadPatientIDException()
Expand All @@ -20,9 +19,5 @@ public BadPatientIDException(string message) : base(message)
public BadPatientIDException(string message, Exception innerException) : base(message, innerException)
{
}

protected BadPatientIDException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,11 @@
case string[] arr:
{
var unique = arr.Where(a => !string.IsNullOrWhiteSpace(a)).Distinct().ToArray();

return unique.Length switch
{
0 => null,
1 => unique[0],
_ => throw new BadPatientIDException(
$"DicomDataset had multiple values for PatientID:{string.Join("\\", arr)}")
};
if (unique.Length == 0)
return null;

Check warning on line 228 in src/microservices/Microservices.IdentifierMapper/Messaging/IdentifierMapperQueueConsumer.cs

View check run for this annotation

Codecov / codecov/patch

src/microservices/Microservices.IdentifierMapper/Messaging/IdentifierMapperQueueConsumer.cs#L228

Added line #L228 was not covered by tests
if (unique.Length == 1)
return unique[0];
throw new BadPatientIDException($"DicomDataset had multiple values for PatientID:{string.Join("\\", arr)}");
}
default:
throw new BadPatientIDException($"DicomDataset had bad Type for PatientID:{val.GetType()}");
Expand Down
Loading