You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All the controllers are injected as singletons. So if we have a transient or scoped service to be injected in a controller, it won't work because it has a shorter lifetime.
For ex resolving a scoped service in a controller will always return the same instance of that service because the containing class is a singleton.
Am I missing something or is that assumption right ?
The text was updated successfully, but these errors were encountered:
Elie-A-98
changed the title
will injecting a transient or scope service in any controller work ?
Injecting a transient or scope service won't work
Jul 8, 2024
Elie-A-98
changed the title
Injecting a transient or scope service won't work
Injecting a transient or scoped service won't work
Jul 8, 2024
All the controllers are injected as singletons. So if we have a transient or scoped service to be injected in a controller, it won't work because it has a shorter lifetime.
For ex resolving a scoped service in a controller will always return the same instance of that service because the containing class is a singleton.
Am I missing something or is that assumption right ?
The text was updated successfully, but these errors were encountered: