Exemplo n.º 1
0
        /// <summary>
        /// 配置对MVC控制器的访问。
        /// Configures access to an MVC controller.
        /// </summary>
        public ControllerDataSourceOptionsBuilder Mvc()
        {
            ControllerDataSourceOptionsBuilder controllerDataSourceOptionsBuilder = new ControllerDataSourceOptionsBuilder(_context);

            if (UseLegacyRouting)
            {
                controllerDataSourceOptionsBuilder.RouteName("default");
            }
            return(controllerDataSourceOptionsBuilder);
        }
Exemplo n.º 2
0
        public ControllerDataSourceOptionsBuilder WebApi()
        {
            ControllerDataSourceOptionsBuilder controllerDataSourceOptionsBuilder = new ControllerDataSourceOptionsBuilder(_context);

            if (UseLegacyRouting)
            {
                controllerDataSourceOptionsBuilder.LoadAction("Get").InsertAction("Post").UpdateAction("Put")
                .DeleteAction("Delete");
            }
            return(controllerDataSourceOptionsBuilder);
        }