Skip to content

feat(di)!: remove 11 throwing DI-builder stub methods#156

Merged
AbongileBoja merged 1 commit intodevelopfrom
feat/remove-di-stubs-139
Apr 27, 2026
Merged

feat(di)!: remove 11 throwing DI-builder stub methods#156
AbongileBoja merged 1 commit intodevelopfrom
feat/remove-di-stubs-139

Conversation

@AbongileBoja
Copy link
Copy Markdown
Owner

Summary

4.0 BREAKING — Phase 3b of v4 release. Closes the 3.x deprecation shipped in #77. Every removed method shipped on the public surface only to throw NotImplementedException; all 11 carried [Obsolete(error: true)] for the 3.x line. ApiCompat reports CP0001 (member removed) on each.

Removed

Builder Method Replacement
AuditingBuilder LogAllQueries() wire your own IAuditLogger via WithAuditing(a => a.UseLogger(myLogger))
AuditingBuilder TrackChanges() implement change tracking inside your IAuditLogger
AuditingBuilder EnableEncryption() encrypt entries inside your IAuditLogger using IEncryptionProvider
AuditingBuilder UseDatabase(string) wire a database-backed IAuditLogger
AuditingBuilder RetentionDays(int) use IAuditMaintenance.PurgeOldLogsAsync on a schedule
CachingBuilder EnableCompressionForLarge(int) wrap ICacheProvider with a compressing decorator (e.g. Scrutor Services.Decorate)
MonitoringBuilder EnableOpenTelemetry() call Services.AddOpenTelemetry() directly on the builder's Services property
MonitoringBuilder EnableHealthChecks() call Services.AddHealthChecks() directly on the builder's Services property
PerformanceBuilder EnableQueryCaching() use WithCaching(c => c.UseMemoryCache()) and compose your query path
PerformanceBuilder OptimizeExpressions() no replacement — handled by EF Core / IQueryable providers
SecurityBuilder RotateKeysEvery(int) implement key rotation at the storage layer (decrypt with old, re-encrypt with new)

Also removed: AuditingBuilder class-level <remarks> block telegraphing the removal (its purpose is served).

Tests

7 throw-asserting tests removed as planned (6 in IndividualBuildersTests, 1 in QuerySpecBuilderTests):

  • CachingBuilder_EnableCompressionForLarge_Throws_NotImplemented
  • PerformanceBuilder_EnableQueryCaching_Throws_NotImplemented
  • PerformanceBuilder_OptimizeExpressions_Throws_NotImplemented
  • SecurityBuilder_RotateKeysEvery_Throws_NotImplemented
  • AuditingBuilder_AllStubs_Throw_NotImplemented
  • MonitoringBuilder_AllStubs_Throw_NotImplemented
  • WithMonitoring_StubsThrowAtConfigTime

Now-orphaned AssertReflectiveThrows helper deleted alongside.

Local verification

  • dotnet build -c Release -p:QUERYSPEC_SKIP_SIGN=true — 0 errors
  • dotnet test -c Release720 unique tests green across net8.0/9.0/10.0 (was 727; 7 removed as planned)

Phase context

Closes #139
Refs #77

BREAKING CHANGES — Phase 3b of v4 release. Closes the 3.x deprecation
shipped in #77. Every removed method shipped on the public surface only to
throw NotImplementedException; all 11 carried [Obsolete(error: true)] for
the 3.x line. ApiCompat reports CP0001 on each.

Removed:
- AuditingBuilder.LogAllQueries / TrackChanges / EnableEncryption /
  UseDatabase(string) / RetentionDays(int)
- CachingBuilder.EnableCompressionForLarge(int)
- MonitoringBuilder.EnableOpenTelemetry / EnableHealthChecks
- PerformanceBuilder.EnableQueryCaching / OptimizeExpressions
- SecurityBuilder.RotateKeysEvery(int)
- AuditingBuilder class-level <remarks> block telegraphing the removal
- 7 throw-asserting tests (6 in IndividualBuildersTests, 1 in
  QuerySpecBuilderTests) plus the now-orphaned AssertReflectiveThrows helper.

Per-method migration guidance documented in CHANGELOG. Tests: 720 unique
(was 727; 7 removed as planned) green across net8.0/9.0/10.0.

Closes #139
Refs #77
@AbongileBoja AbongileBoja merged commit ed3be34 into develop Apr 27, 2026
13 of 14 checks passed
@AbongileBoja AbongileBoja deleted the feat/remove-di-stubs-139 branch April 27, 2026 15:33
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.

Remove obsolete DI-builder stub methods in 4.0

1 participant