I want to modify some Controllers for which i need to add few more parameters to the Constructor of the Controller. If I add more parameters, it won't work. Can you please suggest where do I need to map the parameters (for ioc) so that it works fine?
Controller Constructor Parameters
#1
Geschrieben: 31 March 2014 - 19:37
#2
Geschrieben: 31 March 2014 - 20:43
Objects auto resolved by autofac needs to be registered in \Presentation\SmartStore.Web.Framework\DependencyRegistrar.cs.
Marcus Gesing
Smartstore AG
#3
Geschrieben: 01 April 2014 - 05:19
Thanks for the reply. Can you please share some code or any example?
#4
Geschrieben: 01 April 2014 - 05:31
here is the original store controller -
After modification, it should look like -
#5
Geschrieben: 01 April 2014 - 14:18
private readonly IStoreService _storeService; private readonly ISettingService _settingService; private readonly ILocalizationService _localizationService; private readonly IPermissionService _permissionService; private readonly ILocationService _locationService; private readonly ICountryService _countryService; private readonly IStateProvinceService _stateProvinceService; public StoreController(IStoreService storeService, ISettingService settingService, ILocalizationService localizationService, IPermissionService permissionService, ILocationService locationService, ICountryService countryService, IStateProvinceService stateProvinceService) { this._storeService = storeService; this._settingService = settingService; this._localizationService = localizationService; this._permissionService = permissionService; this._locationService = locationService; this._countryService = countryService; this._stateProvinceService = stateProvinceService; }
ILocationService is unknown (not a build in service), so it needs to be registered as described above.
Marcus Gesing
Smartstore AG
#6
Geschrieben: 01 April 2014 - 18:57
thanks, finally, I am able to make it work
Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: IOC, Autofac, Controller, Constructor
Smartstore (English) →
Customize & Extend Smartstore →
Calling a controller function for a plugin controller not workEröffnet von Wlady - 26 Feb 2020 plugin, controller und noch 1 weitere... |
|
|
||
Smartstore (English) →
General Smartstore →
Circular component dependency detectedEröffnet von Sherif Ahmed - 13 Mar 2019 Autofac |
|
|
||
Smartstore (English) →
Customize & Extend Smartstore →
Extending ProjectEröffnet von Aaron Jones - 12 Feb 2016 Model, Extending, Controller und noch 1 weitere... |
|
|