v9.6.2017.0808   重构正向工程,基于映射表查找数据库字段类型到实体类型的映射
大石头 编写于 2017-08-08 21:38:06
X
using System.Web.Mvc;
using System.Web.Routing;
using NewLife.Cube.Controllers;

namespace NewLife.Cube
{
    /// <summary>路由配置</summary>
    public class RouteConfig
    {
        /// <summary>注册路由</summary>
        /// <param name="routes"></param>
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("Content/{*relpath}");
            routes.IgnoreRoute("Scripts/{*relpath}");
            routes.IgnoreRoute("Images/{*relpath}");

            if (routes["Cube"] == null)
            {
                // 为魔方注册默认首页,启动魔方站点时能自动跳入后台,同时为Home预留默认过度视图页面
                routes.MapRoute(
                    name: "Cube",
                    url: "{controller}/{action}/{id}",
                    defaults: new { controller = "CubeHome", action = "Index", id = UrlParameter.Optional },
                    namespaces: new[] { typeof(CubeHomeController).Namespace }
                    );
            }
        }
    }
}