I have the following action:
public PartialViewResult Analyze()
{
var viewModel = new WelcomeAnalyzeViewModel
{
IsDrugsPanelVisible = !Service.IsMDStandalone(),
IsDevicesPanelVisible = Service.IsSubscribedToMedTech(),
IsCompaniesPanelVisible = !Service.IsCTStandalone(),
IsCountriesPanelVisible = !Service.IsCTStandalone() || (Service.IsCTStandalone() && Service.HasImsAddOn()),
IsFinancePanelVisible = !Service.IsCTStandalone()
};
return PartialView("Analyze", viewModel);
}
I'm not sure if I should just pass the Service
property to the constructor of the WelcomeAnalyzeViewModel
or leave this code as is but from the perspective of a thin controller this doesn't feel right.
The Service
property contains an object to a permission service (IPermissionService
) which can be used for other applications outside of the web environment.
Would it be acceptable for one service to call another service, so for instance I create an AnalyzeService
which contains methods with calls to IPermissionService
methods?