Feature Request/Question: Ability to easily author/inject new directives for Razor?
See original GitHub issueFrom @fir3pho3nixx on March 24, 2018 18:58
Currently, I cannot find an easy way to author/inject custom directives into Razor whilst using ASPNET Core Mvc(Kestrel).
I can see that the @Inject
directive gets registered within razor here. Now if I wanted to inject a custom directive to MVC on startup how would I achieve that easily? Imagining for a second I wanted to create a ‘@FooInjector’.
I can see you offer access to RazorViewEngineOptions is this potentially where you guys would expose something like this?
Copied from original issue: aspnet/Mvc#7540
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Ability to easily author/inject new directives for Razor? ...
Currently, I cannot find an easy way to author/inject custom directives into Razor whilst using ASPNET Core Mvc(Kestrel).
Read more >What is a Feature Request? Understanding User Feedback
Requests to integrate with other products your customers use; Requests to update a popular existing functionality; Requests for completely new functionality.
Read more >Product Feature Requests - How to Write and Submit Them
Describes the Feature Request process and provides tips on how to write a Feature Request for best results.
Read more >Aligning Product Strategy with Customer Feature Requests
We've all been on customer calls where we're asked for a feature that just does not align with our product strategy.
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
@allisonchou compiler ❤️
Ok first of all, I totally respect your team and thanks for designing this product so well that I could inject new directives. Seriously job well done team. Your design is spot on keep it going …
** Warning crazy long ass rant with expletives about the fucking mentalists in the aspnet team. **
Why am I asking for this so soon?
Background
I have joined the castle project as an OSS contributor. We might all think they are “passed due” but unfortunately the fact is they invented the first IoC container for dotnet. They also had some really gifted developers which evolved their envisioning of what module inversion would look like today(sic: https://en.wikipedia.org/wiki/Inversion_of_control). IoC containers now are a dime a dozen. Windsor was first period, they learnt all of these problems a long time ago.
Crazy drugged up, drunken mother f%#king David Fowler invented Microsoft.Extensions.DependencyInjection.Abstractions. This made some really bold assumptions about how containers work today. It completely ignored the framework offering of the disposable pattern and augmented scoped behaviour with a god damn service locator pattern. F%#king rubbish really considering it earned us(Castle) the title of non-conforming container.
If you think service location is bad please ask Ploeh.
The point
The only reason I am asking for this feature via kestrel is because I believe I need to write a new @inject directive based on this experimental PR which led to this failed PR. Your work here is only expedited by the failings of https://github.com/aspnet/Mvc/issues/5403.
Conclusion
Please take your time on this one. You guys are doing a great job, I am unfortunately trying to work round what the aspnet d1ckh3ds gave us to work with. No rush.
Again this is not what I meant.