AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Need a more real world example

Open KlomDark opened this issue 2 years ago • 0 comments

Description

[Enter feedback here] The article starts out with "Suppose you had a repository of rules you wanted to evaluate inside an authorization handler and that repository was registered in the service collection. Authorization resolves and injects that into the constructor." (Which is similar to what I need) but then the example is just a simple logger factory, not a rules repository.

Could you please expand it and show how to pass a Scoped Service (Already defined in the builder, but I need a reference to the same "singleton-like" service that the builder is going to create) into the policy requirement.

Thank you

Page URL

https://learn.microsoft.com/en-us/aspnet/core/security/authorization/dependencyinjection?view=aspnetcore-7.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authorization/dependencyinjection.md

Document ID

5c2b0d48-ef1a-5875-35d1-865cb022fa71

Article author

Rick-Anderson

KlomDark avatar Oct 17 '23 07:10 KlomDark