I'm trying to use dependency injection in DNN to resolve the IPortalInfo service in my SchedulerClient and in my FeatureController. I want to access the current PortalId somehow. But for the SchedulerClient I receive the following error when trying to use the constructor dependency injection:
Unable to resolve service for type 'DotNetNuke.Abstractions.Portals.IPortalInfo' while attempting to activate 'XXX'.
For the FeatureController class it is not working either since it requires a parameterless constructor. Is there any other way to resolve the IPortalInfo service. Currently I'm using the DotNetNuke.Entities.Portals.PortalInfo class but it is deprecated.
DotNetNuke.Entities.Portals.PortalInfo
(IPortalInfo)DependencyProvider.GetService(typeof (IPortalInfo)); using the PortalModuleBase is not working for the IPortalInfo.
(IPortalInfo)DependencyProvider.GetService(typeof (IPortalInfo));
Okay, thanks a lot for the quick reply. That should solve my problem.
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.