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=4
The
Index
method 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.RenderBody
is 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.
ViewBag
is a dynamic object, which means you can put whatever you want in to it; theViewBag
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 updatingMovie
class instances in a database. TheMovieDBContext
derives from theDbContext
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).