Service Lifetimes in Blazor and Navigation
问题 Asumme this setup: Page1: - Component A - Component B Page2: - Component C - Component D Service: MyService I want Component A und B to get the same instance of MyService. Component C and D should get a fresh (and the same) instance of MyService. When I register MyService as transient each Component gets a fresh instance. When I register as singleton / scoped all components share the same instance. Components are part of library and thus I am looking for solution that requries no or very