Skip to content

refactor: tidy the extension + multi-target (netstandard2.0;net8.0)#5

Merged
ChrisonSimtian merged 1 commit into
mainfrom
refactor/tidy-and-multitarget
Jul 24, 2026
Merged

refactor: tidy the extension + multi-target (netstandard2.0;net8.0)#5
ChrisonSimtian merged 1 commit into
mainfrom
refactor/tidy-and-multitarget

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

First modernization pass — the uncontroversial bits.

Tidy / bug fixes (clears all warnings)

  • Consolidates the two near-identical RegistrationStrategy classes into one taking an optional client name; removes the dead Instance/GetInstance singleton (never assigned → the CS8618).
  • Null-checks the reflected AddHttpClient<,> lookup + the descriptor's implementation type → clear InvalidOperationExceptions instead of an opaque NullReferenceException (the CS8602s). Caches the resolved generic method definitions.
  • Drops unused usings; adds XML docs.

Multi-target

  • netstandard2.0;net8.0 (was net8.0 only) for broad reach; both Scrutor 7 and Microsoft.Extensions.Http support them. LangVersion=latest so 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.

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>
@ChrisonSimtian ChrisonSimtian added cleanup Code cleanup / refactor refactor Code refactor labels Jul 24, 2026
@ChrisonSimtian
ChrisonSimtian merged commit dc34f4c into main Jul 24, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the refactor/tidy-and-multitarget branch July 24, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code cleanup / refactor refactor Code refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant