New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dependency Injection support in SkinObject #4954
Comments
Thx @bdukes for showing me dnn DI extension methods that can simplify code above. IServiceScope currentScope = HttpContext.Current.GetScope();
IServiceProvider serviceProvider = HttpContext.Current.GetScope().ServiceProvider; |
In #4955 (comment) is example code that can be used in Skin Object also. It is from 2sxc documentation - Depedency Injection in Dnn Skins and Modules. Thx @iJungleboy 👍 |
We have detected this issue has not had any activity during the last 90 days. That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue. We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 14 days, the issue will be closed automatically. |
This issue has been closed automatically due to inactivity (as mentioned 14 days ago). Feel free to re-open the issue if you believe it is still relevant. |
Description of problem
In DNN skin control code developer need clean and simple way to get services registered with DNN9 DI.
Description of solution
In DNN WebForms module we use ServiceProvider from PortalModuleBase.DependencyProvider.
Expected solution will be expanding SkinObjectBase with same DependencyProvider property.
Description of alternatives considered
Something simmilar to this ugly, hacky workaround :-(
Additional context
Developing code that use dependencies registered in DNN9 DI, but without DNN9 DI is not nice.
Expanding SkinObjectBase API with DependencyProvider looks as best solution/workaround in this moment, until constructor injection become reality.
Affected browser
The text was updated successfully, but these errors were encountered: