public HomeController() { #region Общий код для всех контроллеров SM.TryToLoginByCookiesIfNeed(); ViewBag.L = LayoutViewModel.GetLayoutViewModel(); #endregion }
public AdminController() { var currentUser = SM.CurrentUser; if (currentUser == null || !currentUser.IsAdmin) { throw new Exception("Доступ запрещен"); } #region Общий код для всех контроллеров SM.TryToLoginByCookiesIfNeed(); ViewBag.L = LayoutViewModel.GetLayoutViewModel(); #endregion }