Skip to content

Engine+Mongo: Target net8 and net9 instead of netstandard2.1#917

Merged
kennethmyhra merged 7 commits into
FirelyTeam:r4/masterfrom
kennethmyhra:r4-move-away-from-netstandard
Apr 27, 2025
Merged

Engine+Mongo: Target net8 and net9 instead of netstandard2.1#917
kennethmyhra merged 7 commits into
FirelyTeam:r4/masterfrom
kennethmyhra:r4-move-away-from-netstandard

Conversation

@kennethmyhra
Copy link
Copy Markdown
Collaborator

No description provided.

@kennethmyhra kennethmyhra requested a review from Copilot April 27, 2025 15:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the target frameworks from netstandard2.1 to net8 and net9 while also refactoring header handling and related methods to use Append rather than Add. Key changes include:

  • Parsing query strings using HttpUtility in FhirServiceExtensions.
  • Changing header operations in various classes from Add to Append.
  • Updating IServiceCollection extension methods to return IMvcBuilder instead of IMvcCoreBuilder, along with related documentation updates.

Reviewed Changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Spark.Engine/Service/FhirServiceExtensions/ResourceManipulationOperationFactory.cs Replaces custom query string parsing with HttpUtility.ParseQueryString.
src/Spark.Engine/Handlers/FormatTypeHandler.cs Updates header addition from Add to Append for proper header handling.
src/Spark.Engine/Formatters/BinaryOutputFormatter.cs Similar header change to Append to avoid duplicate header registrations.
src/Spark.Engine/Extensions/IServiceCollectionExtensions.cs Changes extension method return types from IMvcCoreBuilder to IMvcBuilder.
src/Spark.Engine/Extensions/HttpRequestFhirExtensions.cs Alters header additions to use Append and replaces response.Body check with ContentLength.
src/Spark.Engine/ExceptionHandling/ErrorHandler.cs Removes HttpResponseException handling branch.
src/Spark.Engine/Core/RequiredAttributeException.cs Removes unused serialization constructor.
src/Spark.Engine.Test/Formatters/ResourceXmlInputFormatterTests.cs & ResourceJsonInputFormatterTests.cs Updates tests expectations in line with new content type handling.
Documentation/MigrateFromv2Tov3.md Updates migration docs to reflect new target frameworks and changes to extension methods.
Files not reviewed (2)
  • src/Spark.Engine/Spark.Engine.csproj: Language not supported
  • src/Spark.Mongo/Spark.Mongo.csproj: Language not supported
Comments suppressed due to low confidence (2)

src/Spark.Engine/ExceptionHandling/ErrorHandler.cs:50

  • The removal of the HttpResponseException handling branch could lead to unhandled exceptions if HttpResponseException is thrown; please confirm that alternative exception handling is in place.
else if (exception is HttpResponseException ex2)

src/Spark.Engine/Extensions/HttpRequestFhirExtensions.cs:173

  • Replacing the null check on response.Body with a ContentLength check changes the semantics; verify that this condition correctly identifies cases where a response body exists and that no valid responses are missed when ContentLength is 0.
if (response.ContentLength > 0)

Comment thread Documentation/MigrateFromv2Tov3.md
Also, removes HttpResponseException handling branch, replaces
UriExtensions.ParseQueryString() with HttpUtility.ParseQueryString().

Adds a FramworkReference to Microsoft.AspNetCore.App and removes all
other somewhat similar PackageReferences. This is in line with the
assemblies we actually want to be referencing.
Using IHeaderDictionary.Add() gives warning suggesting to use
IHeaderDictionary.Append(), so let's move to that.
HttpResponse.Body will never be null so check instead if ContentLength
is above zero.
The AddControllers() should be a more lightweight and also more proper
method for our library to call.
@kennethmyhra kennethmyhra force-pushed the r4-move-away-from-netstandard branch from 0fbd6e0 to 0891d85 Compare April 27, 2025 15:37
@kennethmyhra kennethmyhra merged commit c7102ba into FirelyTeam:r4/master Apr 27, 2025
5 checks passed
@kennethmyhra kennethmyhra deleted the r4-move-away-from-netstandard branch April 27, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants