Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a mistake in tutorial #499

Open
shabnamEsmaeili opened this issue Jun 12, 2024 · 0 comments
Open

a mistake in tutorial #499

shabnamEsmaeili opened this issue Jun 12, 2024 · 0 comments

Comments

@shabnamEsmaeili
Copy link

shabnamEsmaeili commented Jun 12, 2024

hi
I am developing a server with blacksheep and it should have DI with singleton and some background job of the singleton classes. In your tutorial it is said that we can get the singleton object like this:

service = app.service_provider[Example]

but it comes with error that exception=AttributeError("'Application' object has no attribute 'service_provider'")

I came to an answer that it should be like this instead:

service = app.services.provider[Example]

https://www.neoteroi.dev/blacksheep/dependency-injection/#services-that-require-asynchronous-initialization

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

No branches or pull requests

1 participant