Dependency injection in hooks #39
MostafaEsmaeili
started this conversation in
Show and tell
Replies: 2 comments
-
Hi @MostafaEsmaeili thats actually already possible despite that this part could really need a better documentation. the data object you get in all the hooks not only carries the GenericDataContext to do custom queries but also the HTTPContext which exposes a RequestServices function effectively giving you the IServiceCollection you can use to get services. Does that help you? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, @DeeJayTC. Yes, that is what I am looking for. Thank you for your response. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be beneficial if the library could support dependency injection in hooks, as it would make it much easier to manage dependencies and improve the overall design of the code. or at least all hooks access to
IServiceProvider
to resolve dependencies.Is it possible to add support for dependency injection in hooks? If so, I would greatly appreciate it if this could be implemented in a future release of the library.
Thank you for your hard work on this project and I look forward to hearing back from you.
Beta Was this translation helpful? Give feedback.
All reactions