售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Learning ASP.NET Core MVC Programming
Learning ASP.NET Core MVC Programming
Credits
About the Author
About the Reviewers
www.PacktPub.com
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Introduction to ASP.NET Core
How web applications work
So what is an HTTP protocol?
Request-response pattern
Stateless nature of HTTP
Client-side and server-side
HTTP methods
GET method
POST method
What is ASP.NET?
ASP.NET Web Forms
ASP.NET Web Pages
ASP.NET MVC
Features of ASP.NET MVC
Convention over configuration
Separation of concerns
Control over the generated HTML
Better support for unit testing
ASP.NET 5
Features of ASP.NET 5
Summary
2. Setting Up the Environment
Purpose of IDE
Visual Studio offerings
System requirements
Visual Studio Community 2015
Visual Studio Professional
Visual Studio Enterprise
Visual Studio Test Professional
Installing Visual Studio Community
Installing ASP.NET 5
Project structure in ASP.NET 5 application
File-based project
Support for full .NET and .NET core
The Project.json package
Controllers
Models
Views
Migrations
The wwwroot folder
Other files
Summary
3. Controllers
Role of the Controller in ASP.NET MVC applications
Introduction to routing
Creating ASP.NET 5 application
Installing the ASP.NET Core NuGet package in your application
Our first Controller
IActionResult
Adding Views
Adding Models
Passing data from Controller to View
Filters
Authorization filters
Resource filters
Action filters
Exception filters
Result filters
Summary
4. Views
The View engine and the Razor View engine
Razor View engine
Programming in Razor View engine
Variables in Razor View
The for loop
The while loop
The foreach loop
The if condition
Layout
Creating _ViewStart.cshtml
Creating _Layout.cshtml
Adding a page-specific View
Generating HTML
HTML Helpers
Partial View
Calling the Partial View
View components
Creating a View component
Tag Helpers
Creating custom Tag Helpers
Summary
5. Models
Models
Models specific to a View component
Note on ViewModels
Data flow with respect to a Model
Model binding
The Entity Framework
The Entity Framework is independent of ASP.NET MVC
Creating console applications with the Entity Framework
Installing the Entity Framework 7 NuGet package
Using the NuGet Package Manager
Using the Package Manager Console
Installing Entity Framework commands
Creating Model classes
Creating the DbContext class
Create a migration
How the SaveChanges method works
Updating the record
Deleting the record
Using the Entity Framework in ASP.NET MVC applications
Database migration
Summary
6. Validation
Client-side and server-side validation
Server-side validation
Updating View models with the Data Annotation attribute
Updating the View model to display the validation error message
Updating the controller action method to verify the model state
Client-side validation
Implementation
Summary
7. Routing
Convention-based routing
Example 1
Example 2
Example 3
Example 4
Attribute-based routing
Route attribute at the controller level
Passing routing values in HTTP action verbs in the Controller
Route Constraints
Summary
8. Beautifying ASP.NET MVC Applications with Bootstrap
Knowing HTML and CSS
Bootstrap
Bootstrap Grid system
Forms
Inline forms
Horizontal forms
Table CSS classes
Striped tables
Hover tables
Bordered tables
Contextual classes in table
Buttons
Button sizes
Contextual colors
Using Bootstrap in your ASP.NET MVC application
Installing with Bower
HTML doctype
Summary
9. Deployment of ASP.NET Core Application
The project.json file
The dependencies node
The frameworks node
Microsoft Azure
Signing up to Microsoft Azure
Prerequisites to Azure deployment
Deploying the ASP.NET Core application in Azure
Deploying the ASP.NET Core web application in the Linux environment
Creating a Linux machine
Installing the PuTTY client
Installing of .NET Core in a Linux machine
Creating a new ASP.NET 5 project
Configuring the Nginx server
Summary
10. Building HTTP-based Web Services Using ASP.NET Web API
HTTP basics
HTTP verbs
GET method
PUT method
POST method
DELETE method
Fiddler tool
Dependency Injection
Delete method
The Web API method for deleting a resource
Web Repository layer code for deleting the employee data
Summary
11. Improving Performance of an ASP.NET Core Application
The UI layer
Reducing the number of HTTP requests
Using GZip compression
Using the Content Delivery Network (CDN)
Using JavaScript wherever possible
Using CSS stylesheets
Minification of JavaScript and CSS files and their combination
The caching process
Client-side caching
Response caching
The web/application layer
No business logic in Views
Using asynchronous logging
The DB layer
Understanding the queries generated by the ORM
Using classic ADO.NET if you really want to
Return only the required data
Fine tuning the indices
Using the correct column type and size for your database columns
Avoiding correlated subqueries
Generic performance improvement tips
Avoiding the Response.Redirect method
Using string builder
Summary
12. ASP.NET Core Identity
Authentication
Authorization
Adding the relevant dependencies to the project.json file
Adding ApplicationUser and ApplicationDbContext classes
Configuring the application to use Identity
Creating ViewModels
Creating Controllers and associated action methods
Creating Views
E-mail and SMS services
Securing an action method in a Controller
Summary
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜