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
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.
From previous experience with Angular, I really loved their dependency injection that required only to inject the service as a private property in the constructor.(Angular Documentation)
It was quicker for the programmer to do so and less painfull in projects with multiple services injected per class.
Proposed Changes:
It would be appreciated if we could inject a service like this:
publicclassController:ControllerBase{publicController(privatereadonly InjectedService _injectedService){}// OR with default readonlypublicController(privateInjectedService _injectedService){}publicvoidSomeMethod(){_injectedService.doSomething();}}
The text was updated successfully, but these errors were encountered:
Eilon
added
the
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
label
Jul 23, 2019
It's a language feature (in your Angular case, it's a TypeScript feature), not framework. There are some similar proposals in compiler repo, like this one: dotnet/roslyn#14853
But if you're planning on adding a new proposition, note that it must be posted to the language repo itself: https://github.com/dotnet/csharplang
mkArtakMSFT
added
the
External
This is an issue in a component not contained in this repository. It is open for tracking purposes.
label
Jul 25, 2019
ghost
locked as resolved and limited conversation to collaborators
Dec 3, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesExternalThis is an issue in a component not contained in this repository. It is open for tracking purposes.
Is your feature request related to a problem? Please describe.
I've been working with .net core for several years right now and I find it annoyingly repetitive and long to inject services. Here's why:
In order to inject a service, you need to :
Describe the solution you'd like
From previous experience with Angular, I really loved their dependency injection that required only to inject the service as a private property in the constructor.(Angular Documentation)
It was quicker for the programmer to do so and less painfull in projects with multiple services injected per class.
Proposed Changes:
It would be appreciated if we could inject a service like this:
The text was updated successfully, but these errors were encountered: