We have this old servie:
public MetaDataUtilities(MetaService metaService, LanguageService languageService, RequestModelAccessor requestModelAccessor, RouteRequestLookupInfoAccessor routeRequestLookupInfoAccessor)
{
_metaService = metaService;
_languageService = languageService;
_routeRequestLookupInfoAccessor = routeRequestLookupInfoAccessor;
_requestModel = requestModelAccessor.RequestModel;
}
That we inject into our HeadViewModelBuilder.
When the _headViewModelBuilder.Build() is called from the LayoutControllers ChildActions (“Head”) the _requestModel work just fine, but if i call the _headViewModelBuilder.Build() directly from the Home or Product controller the_requestModel is null.
I can rewrite our service to use: _requestModelAccessor.RequestModel insted, that works fine. But am just curius why, what are the different between injecting it in a ViewChildAction vs in a controller?
Litium version: 7.4