You can create helper classes which will perform some logic and you can call them either in the controllers or on the views. I do not know if it is that that you want.
For example, i have created a folder called Repository (repository pattern) where i implement for example the logic to render a menu:
public class reposAccount
{
public static List<Sp_ShowMenuList_Result> ShowMenuList(int RoleID)
{
myEntities db = new myEntities();
List<Sp_ShowMenuList_Result> ListShowMenu = db.Sp_ShowMenuList(RoleID).ToList();
return ListShowMenu;
}
}
And the on the View i just call that "Helper":
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
//do some preparatory activities, then i call the helper:
foreach (var obj in reposAccount.ShowMenuList(RoleId).Where(z => z.ParentMenu == null).OrderBy(z => z.MenuOrder).ToList())
{
@: <li>@Html.ActionLink(obj.MenuName, "Index", obj.Controler_Name)</li>
}
}
The same behaviour or the methods, you could call them on each controller.