refactor: tidy the extension + multi-target (netstandard2.0;net8.0)#5
Merged
Merged
Conversation
Tidy / bug fixes (clears all CS8618/CS8602 warnings): - Consolidate the two near-identical registration strategies into one that takes an optional client name; remove the dead, never-assigned Instance/GetInstance singleton (the CS8618 source). - Null-check the reflected AddHttpClient<,> lookup and the descriptor's implementation type, throwing clear InvalidOperationExceptions instead of an opaque NullReferenceException if the MEH API shape ever changes or the selector is misused. Cache the resolved generic method definitions. - Drop unused usings; XML docs on the public overloads. Multi-target: - netstandard2.0;net8.0 (was net8.0 only) for broad consumer reach; both Scrutor 7 and Microsoft.Extensions.Http support these. LangVersion=latest so modern C# compiles on netstandard2.0. Public API surface unchanged (PublicApiGenerator baseline still green); all 7 specs pass; package now ships lib/net8.0 + lib/netstandard2.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First modernization pass — the uncontroversial bits.
Tidy / bug fixes (clears all warnings)
RegistrationStrategyclasses into one taking an optional client name; removes the deadInstance/GetInstancesingleton (never assigned → theCS8618).AddHttpClient<,>lookup + the descriptor's implementation type → clearInvalidOperationExceptions instead of an opaqueNullReferenceException(theCS8602s). Caches the resolved generic method definitions.Multi-target
netstandard2.0;net8.0(wasnet8.0only) for broad reach; both Scrutor 7 andMicrosoft.Extensions.Httpsupport them.LangVersion=latestso modern C# compiles on netstandard2.0.Public API unchanged (PublicApiGenerator baseline still green), all 7 specs pass, package ships
lib/net8.0+lib/netstandard2.0.Source-generator rewrite is intentionally not here — there's a design fork to settle first.