Skip to content

Releases: Skymly/DesignPatterns

Release list

0.2.2

Choose a tag to compare

@Skymly Skymly released this 30 Jun 10:51

What's New

Singleton captive dependency diagnostic (DP062)

CaptiveDependencyAnalyzer reports DP062 (Warning) when a Singleton service's constructor depends on a Scoped or Transient service. This is the first .NET compile-time captive dependency detector.

Scans AddSingleton/AddScoped/AddTransient/TryAdd(ServiceDescriptor) calls to build a type-to-lifetime registration map, then checks each Singleton implementation's constructor parameters against the map.

Previous preview (0.2.1-preview1) — now stable

  • DI lifetime validation (DP060-DP061): LifetimeMismatchAnalyzer reports captive dependency (DP060, Warning) and wasteful mismatch (DP061, Info) for RegisterDi call-site parameter combinations.
  • DI health checks: AddDesignPatternsHealthChecks extension method registers an IHealthCheck that verifies all DesignPatterns service registrations can be resolved at runtime.

Stats

  • 611 tests passing, zero warnings
  • 3 new diagnostics: DP060, DP061, DP062
  • 26 new tests (6 + 9 + 11)