更新时间:2021-07-23 17:10:17
封面
Title Page
Copyright and Credits
ASP.NET Core 2 Fundamentals
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the authors
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
Setting the Stage
Introduction to Web Applications
How Web Applications Work
What is the HTTP Protocol?
HTTP/2's Edge over HTTP/1.x
Request-Response Pattern
Stateless Nature of HTTP
Advantages to HTTP
Work with the Statelessness and the Request-Response Pattern
Client Side and Server Side
Programming Styles – RPC versus REST
Working with HTTP Methods
The GET Method
The POST Method
List of Important Methods
Other Methods
Activity: Working with the Request-Response Pattern
Introduction to ASP.NET
ASP.NET MVC
The Model-View-Controller Pattern
A File-Based Project
Creating Your First Project
Creating Your First Application
Summary
Controllers
Role of the Controller in ASP.NET MVC Applications
Ideal Flow of Data for a Layered Web Application
Introduction to Routing
Activity: Finding the Correct Method Invoked for a URL
Installing the ASP.NET Core NuGet Package in Your Application
Our First Controller
IActionResult
Activity: Implementing Your Own IActionResult
Adding Views
Adding Models
Passing Data from the Controller to the View
Filters
Activity: Writing a Custom Filter
Views
The View Engine and the Razor View Engine
The Razor View Engine
Programming in the Razor View Engine
Variables in the Razor View
Working with Razor View
Programming Constructs in the Razor View
Activity: Printing Prime Numbers from 1 to 100
Layout
Building our First Layout
Creating _ViewStart.cshtml
Creating _Layout.cshtml
Adding a Page-Specific View
Activity: Creating Another Layout and Changing the View to That Layout
Generating HTML
Generating HTML using a Simple Form
HTML Helpers
Generating a form using HTML Helpers
Activity: Making Use of a Checkbox
Partial View
Calling a Partial View
Activity: Working with Static Data
View Components
Creating a View Component
Creating a ViewComponent Attribute
Activity: Passing a String as Additional Data
Tag Helpers
Custom Tag Helpers
Creating a Custom Tag Helper
Activity: Replacing Email Tag Helpers
Models
Introduction to Models
Creating an ASP.NET Core Application
Models Specific to a View Component
ViewModels
Data Flow with Respect to a Model
Activity: Revising the Code to Show Discount in the Total
Model Binding
Entity Framework
Creating Console Applications with Entity Framework
Installing Entity Framework Core NuGet Package
Using the NuGet Package Manager