0
sparkyjr created
Hi,
I am trying to inject a service through the constructor in WebViewPageBase.cs lying in Web Project -> Views -> WebViewPageBase but its not allowing. Does Dependency Injection through the constructor not work for WebViewPageBase.cs class?
Thanking you in advance.
1 Answer(s)
-
0
Hi,
You can use IocManager.Instance.Resolve<>() in your case. Initial project template injects AbpSession like this,
public abstract class MyCompanyWebViewPageBase<TModel> : AbpWebViewPage<TModel> { public IAbpSession AbpSession { get; private set; } protected MyCompanyWebViewPageBase() { AbpSession = IocManager.Instance.Resolve<IAbpSession>(); LocalizationSourceName = ChatTesterConsts.LocalizationSourceName; } }