ASP.NET - 文档及教程


ASP.NET - 文档及教程

  • Getting Started with ASP.NET MVC 5 | Microsoft Docs

    • Main Ideas:

    • default MVC mapping is /[Controller]/[ActionName]/[Parameters], e.g. http://localhost:xxxx/HelloWorld/Welcome?name=Scott&numtimes=4

    • The Index method in your controller didn’t do much work; it simply ran the statement return View(), which specified that the method should use a view template file to render a response to the browser.

    • Find the @RenderBody() line. RenderBody is a placeholder where all the view-specific pages you create show up

    • A view template should never perform business logic or interact with a database directly.

    • ViewBag is a dynamic object, which means you can put whatever you want in to it; the ViewBag object has no defined properties until you put something inside it.

    • The MovieDBContext class represents the Entity Framework movie database context, which handles fetching, storing, and updating Movie class instances in a database. The MovieDBContext derives from the DbContext base class provided by the Entity Framework.

    • The main class that coordinates Entity Framework functionality for a given data model is the database context class.

    • DAL (for Data Access Layer).