I'm moving all definitions like the following:
@(Model.Store.EmployeeType.Name == "Manager" ? Model.Store.HQ.Manager.DisplayName : Model.Store.Manager.DisplayName )
Out of my View and into a viewModel:
public class ManagerViewModel
{
public string Manager {get;set;}
}
And defining them in the controller:
var viewModel = new ManagerViewModel();
viewModel.Manager = Model.Store.EmployeeType.Name == "Manager" ? Model.Store.HQ.Manager.DisplayName : Model.Store.Manager.DisplayName;
return View(viewModel);
Now, in my View I can do this:
@Model.Manager
My question is - does this violate the skinny controller best practice? I have about 30 fields that need this type of treatment, so my controller is going to be pretty big - I'm creating a new property for every field.