也提到我參考一篇 code first的文章去做
後來實務上需要新增資料表,所以我決定玩玩看code first的作法
http://aaa.bbb/{area}/{controller}/{action}?name=微軟
context.MapRoute(
"AreaName_default",
"AreaName/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
context.MapRoute(
"AreaName_default",
"AreaName/{controller}/{action}/",
new { controller = "Home", action = "Index" }
);
[GET("AreaName/{controller}/{action}/{id}")]
<location path="." inheritInChildApplications="false">
<system.web>
...
</system.web>
</location>
就像這樣