CounterStrikeSharp icon indicating copy to clipboard operation
CounterStrikeSharp copied to clipboard

Add ability to inject IPluginConfig<T>

Open busheezy opened this issue 1 year ago • 2 comments

It would be great to be able to inject our config into different services.

busheezy avatar Mar 08 '24 06:03 busheezy

This is difficult due to the nature of the OnConfigParsed method which sets an instance of config onto the base plugin after instantation, which occurs much later than service collection creation. We can put the type T from IPluginConfig<T> in the container, but it will not have any modifications that are processed by OnConfigParsed. How does that solution fare?

roflmuffin avatar Mar 09 '24 04:03 roflmuffin

This would be solved in #400 if we go ahead with the solution.

Let me know what you think.

frederikstonge avatar Apr 07 '24 11:04 frederikstonge