Support to @inject
See original GitHub issueHi!
I’m trying to use @inject to inject via .netCore DI system some services in my View. But “@inject” it’s not a known tag in RazorLight.
Can you implement this in some future version? Do you want some help to do this?
To now I use a workaround.
Rather than
@inject IServiceUri ServiceUri
I used
@{var ServiceUri = new ServiceUri();}
But… I lost DI 😢
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Why Angular 14's new inject() function is so amazing?
But if you use the inject() function you dont even need a service as a dependency in your component, you just need to...
Read more >Inject (Java EE 6 )
javax.inject. Annotation Type Inject ... Identifies injectable constructors, methods, and fields. May apply to static as well as instance members. An injectable ......
Read more >Assisted Injection
Assisted injection is a dependency injection (DI) pattern that is used to construct an object where some parameters may be provided by the...
Read more >What is the difference between @Inject and @Autowired in ...
Spring has chosen to support using the @Inject annotation synonymously with their own @Autowired annotation. So, to answer your question, ...
Read more >Understanding dependency injection
When you provide the service at the root level, Angular creates a single, shared instance of the HeroService and injects it into any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Add package
Install-Package RazorLight.MVCAdd RazorLight services in Startup.cs
@inject is a feature of ASP.NET MVC, but I planned to add an integration Expect this on beta5 release