Exemplo n.º 1
0
        /// <summary>
        /// Инициализация данных о контроллере
        /// </summary>
        /// <typeparam name="TController">Тип контроллера</typeparam>
        /// <param name="area">Область контроллера</param>
        public static void InitControllerInfo <TController>(string area, ControllerActionsInfo info = null) where TController : System.Web.Mvc.Controller
        {
            if (info == null)
            {
                info = CreateControllerInfo <TController>(area);
            }

            string controllerKeyName = GetControllerFullName <TController>();

            m_controllersActions.AddOrUpdate(controllerKeyName, info, (a, ai_cur) => info);
        }
Exemplo n.º 2
0
        protected static ControllerActionsInfo GetOrCreateControllerInfo <TController>(string area) where TController : System.Web.Mvc.Controller
        {
            string controllerKeyName             = GetControllerFullName <TController>();
            ControllerActionsInfo controllerInfo = null;

            if (m_controllersActions.TryGetValue(controllerKeyName, out controllerInfo))
            {
                return(controllerInfo);
            }
            else
            {
                controllerInfo = CreateControllerInfo <TController>(area);

                InitControllerInfo <TController>(area, controllerInfo);

                return(controllerInfo);
            }
        }