Replies: 1 comment
-
|
Here, I’d keep A container can know the construction graph for a single root, but ordering a collection by “dependencies” is ambiguous (different items can depend on different things, lifetimes/scopes change what’s available, some deps are optional/conditional, async init isn’t the same as construction, etc.). Doing it implicitly at core level would likely be surprising. In VContainer the usual approach is:
Your source-generator graph works, but I’d treat it as an app-level policy rather than a core DI feature. |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I've done a work that I think would be great to have at core level of the package but meybe that work should be done in another more efficient way.
I've created some custom Interface
but some of them depends on each other, and they must be in order of their dependecies. VContainer by default resolves in the order of registration, and to somehow fix it, I've wrote a source generator to create a graph where all types that implements
IGameInitializablewill sorted at generation time, and I can simply sortserviceslike sowhat do you think, is it possible to have resolved collections in order of Dependency Graph or it should be as is ?
Beta Was this translation helpful? Give feedback.
All reactions