ASP.NET - 文档及教程
收藏若干ASP.NET的文档及教程链接
ASP.NET - 文档及教程
Main Ideas:
default MVC mapping is
/[Controller]/[ActionName]/[Parameters], e.g.http://localhost:xxxx/HelloWorld/Welcome?name=Scott&numtimes=4The
Indexmethod in your controller didn't do much work; it simply ran the statementreturn View(), which specified that the method should use a view template file to render a response to the browser.Find the
@RenderBody()line.RenderBodyis a placeholder where all the view-specific pages you create show upA view template should never perform business logic or interact with a database directly.
ViewBagis a dynamic object, which means you can put whatever you want in to it; theViewBagobject has no defined properties until you put something inside it.The
MovieDBContextclass represents the Entity Framework movie database context, which handles fetching, storing, and updatingMovieclass instances in a database. TheMovieDBContextderives from theDbContextbase class provided by the Entity Framework.The main class that coordinates Entity Framework functionality for a given data model is the
database contextclass.DAL (for Data Access Layer).