Introduction |
|
xv | |
Who should read this book |
|
xvi | |
|
|
xvi | |
|
This might not be for you if... |
|
|
xvi | |
Organization of this book |
|
xvii | |
System requirements |
|
xvii | |
Downloads: Code samples |
|
xvii | |
Errata, updates, & book support |
|
xviii | |
Stay in touch |
|
xviii | |
Part 1 The New ASP.NET At A Glance |
|
|
Chapter 1 Why Another ASP.NET? |
|
|
3 | (12) |
|
The Current .NET Platform |
|
|
3 | (4) |
|
Highlights of the .NET Platform |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
4 | (2) |
|
|
6 | (1) |
|
The Need for Super-Simple Web Services |
|
|
6 | (1) |
|
|
7 | (3) |
|
A More Compact .NET Framework |
|
|
7 | (1) |
|
Decoupling ASP.NET from the Host |
|
|
8 | (1) |
|
|
9 | (1) |
|
.NET Core Command-line Tools |
|
|
10 | (3) |
|
|
10 | (1) |
|
|
11 | (1) |
|
Predefined dotnet Commands |
|
|
12 | (1) |
|
|
13 | (2) |
|
Chapter 2 The First ASP.NET Core Project |
|
|
15 | (34) |
|
Anatomy of an ASP.NET Core Project |
|
|
15 | (13) |
|
|
16 | (6) |
|
Interacting with the Runtime Environment |
|
|
22 | (6) |
|
The Dependency Injection Subsystem |
|
|
28 | (6) |
|
Dependency Injection at a Glance |
|
|
28 | (1) |
|
Dependency Injection in ASP.NET Core |
|
|
29 | (3) |
|
Integrating with External DI Libraries |
|
|
32 | (2) |
|
|
34 | (11) |
|
Creating a Single Endpoint Website |
|
|
34 | (7) |
|
Accessing Files on the Web Server |
|
|
41 | (4) |
|
|
45 | (4) |
Part II The ASP.NET MVC Application Model |
|
|
Chapter 3 Bootstrapping ASP.NET MVC |
|
|
49 | (20) |
|
Enabling the MVC Application Model |
|
|
49 | (6) |
|
Registering the MVC Service |
|
|
49 | (3) |
|
Enabling Conventional Routing |
|
|
52 | (3) |
|
Configuring the Routing Table |
|
|
55 | (9) |
|
|
55 | (6) |
|
Advanced Aspects of Routing |
|
|
61 | (3) |
|
Map of ASP.NET MVC Machinery |
|
|
64 | (3) |
|
|
65 | (1) |
|
Processing Action Results |
|
|
66 | (1) |
|
|
66 | (1) |
|
|
67 | (2) |
|
Chapter 4 ASP.NET MVC Controllers |
|
|
69 | (32) |
|
|
69 | (6) |
|
Discovering the Controller Name |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
72 | (3) |
|
|
75 | (7) |
|
Mapping Actions to Methods |
|
|
75 | (4) |
|
|
79 | (3) |
|
Implementation of Action Methods |
|
|
82 | (11) |
|
|
82 | (2) |
|
|
84 | (6) |
|
|
90 | (3) |
|
|
93 | (7) |
|
Anatomy of Action Filters |
|
|
93 | (3) |
|
Little Gallery of Action Filters |
|
|
96 | (4) |
|
|
100 | (1) |
|
Chapter 5 ASP.NET MVC Views |
|
|
101 | (26) |
|
|
101 | (3) |
|
Serving HTML from Terminating Middleware |
|
|
101 | (1) |
|
Serving HTML from Controllers |
|
|
102 | (1) |
|
Serving HTML from Razor Pages |
|
|
103 | (1) |
|
|
104 | (12) |
|
|
104 | (2) |
|
|
106 | (5) |
|
Adding a Custom View Engine |
|
|
111 | (1) |
|
Structure of a Razor View |
|
|
112 | (4) |
|
|
116 | (5) |
|
|
116 | (3) |
|
Strongly Typed View Models |
|
|
119 | (2) |
|
Injecting Data through the DI System |
|
|
121 | (1) |
|
|
121 | (4) |
|
Discovering the Rationale behind Razor Pages |
|
|
121 | (1) |
|
Implementation of Razor Pages |
|
|
122 | (1) |
|
Posting Data from a Razor Page |
|
|
123 | (2) |
|
|
125 | (2) |
|
Chapter 6 The Razor Syntax |
|
|
127 | (24) |
|
|
127 | (10) |
|
Processing Code Expressions |
|
|
128 | (4) |
|
|
132 | (2) |
|
|
134 | (3) |
|
|
137 | (8) |
|
|
137 | (1) |
|
|
138 | (4) |
|
Writing Custom Tag Helpers |
|
|
142 | (3) |
|
|
145 | (3) |
|
|
145 | (1) |
|
The Composition UI Pattern |
|
|
146 | (2) |
|
|
148 | (3) |
Part III Crosscutting Concerns |
|
|
Chapter 7 Design Considerations |
|
|
151 | (26) |
|
The Dependency Injection Infrastructure |
|
|
151 | (8) |
|
Refactoring to Isolate Dependencies |
|
|
151 | (3) |
|
Generalities of the ASP.NET Core DI System |
|
|
154 | (3) |
|
Aspects of the DI Container |
|
|
157 | (1) |
|
Injecting Data and Services in Layers |
|
|
157 | (2) |
|
Collecting Configuration Data |
|
|
159 | (7) |
|
|
159 | (2) |
|
Building a Configuration Document Object Model |
|
|
161 | (3) |
|
Passing Configuration Data Around |
|
|
164 | (2) |
|
|
166 | (4) |
|
|
167 | (1) |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
170 | (1) |
|
|
170 | (6) |
|
Exception Handling Middleware |
|
|
170 | (4) |
|
|
174 | (1) |
|
|
175 | (1) |
|
|
176 | (1) |
|
Chapter 8 Securing the Application |
|
|
177 | (32) |
|
Infrastructure for Web Security |
|
|
177 | (1) |
|
|
177 | (1) |
|
Dealing with Security Certificates |
|
|
178 | (1) |
|
Applying Encryption to HTTPS |
|
|
178 | (1) |
|
Authentication in ASP.NET Core |
|
|
178 | (13) |
|
Cookie-based Authentication |
|
|
178 | (2) |
|
Dealing with Multiple Authentication Schemes |
|
|
180 | (2) |
|
Modeling the User Identity |
|
|
182 | (4) |
|
|
186 | (5) |
|
Authenticating Users via ASP.NET Identity |
|
|
191 | (8) |
|
Generalities of ASP.NET Identity |
|
|
191 | (4) |
|
Working with the User Manager |
|
|
195 | (4) |
|
|
199 | (9) |
|
|
200 | (3) |
|
Policy-based Authorization |
|
|
203 | (5) |
|
|
208 | (1) |
|
Chapter 9 Access to Application Data |
|
|
209 | (28) |
|
Toward a Relatively Generic Application back end |
|
|
209 | (5) |
|
|
210 | (1) |
|
|
211 | (2) |
|
Inside the Infrastructure Layer |
|
|
213 | (1) |
|
|
214 | (8) |
|
|
214 | (2) |
|
|
216 | (3) |
|
Using Micro O/RM Frameworks |
|
|
219 | (2) |
|
|
221 | (1) |
|
|
222 | (12) |
|
|
222 | (4) |
|
|
226 | (4) |
|
Dealing with Transactions |
|
|
230 | (2) |
|
A Word on Async Data Processing |
|
|
232 | (2) |
|
|
234 | (3) |
Part IV Frontend |
|
|
Chapter 10 Designing a Web API |
|
|
237 | (22) |
|
Building a Web API with ASP.NET Core |
|
|
237 | (4) |
|
|
238 | (2) |
|
|
240 | (1) |
|
Designing a RESTful Interface |
|
|
241 | (7) |
|
|
242 | (3) |
|
|
245 | (3) |
|
|
248 | (9) |
|
Planning Just the Security You Really Need |
|
|
248 | (1) |
|
Simpler Access Control Methods |
|
|
249 | (1) |
|
Using an Identity Management Server |
|
|
250 | (7) |
|
|
257 | (2) |
|
Chapter 11 Posting Data from the Client Side |
|
|
259 | (18) |
|
|
259 | (7) |
|
|
259 | (4) |
|
The Post-Redirect-Get Pattern |
|
|
263 | (3) |
|
Posting Forms Via JavaScript |
|
|
266 | (9) |
|
Uploading the Form Content |
|
|
266 | (4) |
|
Refreshing Portions of the Current Screen |
|
|
270 | (2) |
|
Uploading Files to a Web Server |
|
|
272 | (3) |
|
|
275 | (2) |
|
Chapter 12 Client-side Data Binding |
|
|
277 | (18) |
|
Refreshing the View via HTML |
|
|
277 | (7) |
|
|
277 | (1) |
|
Defining Refreshable Areas |
|
|
278 | (1) |
|
|
278 | (6) |
|
Refreshing the View via JSON |
|
|
284 | (9) |
|
Introducing the Mustache.JS Library |
|
|
284 | (4) |
|
Introducing the KnockoutJS Library |
|
|
288 | (5) |
|
The Angular Way to Building Web Apps |
|
|
293 | (1) |
|
|
293 | (2) |
|
Chapter 13 Building Device-friendly Views |
|
|
295 | (22) |
|
Adapting Views to the Actual Device |
|
|
295 | (10) |
|
The Best of HTML5 for Device Scenarios |
|
|
296 | (3) |
|
|
299 | (2) |
|
Client-side Device Detection |
|
|
301 | (3) |
|
|
304 | (1) |
|
|
305 | (3) |
|
|
305 | (1) |
|
|
306 | (1) |
|
Resizing Images Automatically |
|
|
306 | (2) |
|
Device-oriented Development Strategies |
|
|
308 | (6) |
|
Client-centric Strategies |
|
|
308 | (4) |
|
Server-centric Strategies |
|
|
312 | (2) |
|
|
314 | (3) |
Part V The ASP.NET Core Ecosystem |
|
|
Chapter 14 The ASP.NET Core Runtime Environment |
|
|
317 | (26) |
|
|
317 | (8) |
|
|
318 | (3) |
|
|
321 | (4) |
|
|
325 | (7) |
|
Selection of the HTTP Server |
|
|
326 | (2) |
|
Configuring a Reverse Proxy |
|
|
328 | (2) |
|
Kestrel Configuration Parameters |
|
|
330 | (2) |
|
The ASP.NET Core Middleware |
|
|
332 | (8) |
|
|
332 | (3) |
|
Writing Middleware Components |
|
|
335 | (3) |
|
Packaging Middleware Components |
|
|
338 | (2) |
|
|
340 | (3) |
|
Chapter 15 Deploying an ASP.NET Core Application |
|
|
343 | (20) |
|
Publishing the Application |
|
|
343 | (7) |
|
Publishing from within Visual Studio |
|
|
343 | (6) |
|
Publishing Using CLI Tools |
|
|
349 | (1) |
|
Deploying the Application |
|
|
350 | (9) |
|
|
351 | (3) |
|
Deploying to Microsoft Azure |
|
|
354 | (3) |
|
|
357 | (2) |
|
|
359 | (3) |
|
Containers vs. Virtual Machines |
|
|
359 | (1) |
|
From Containers to Microservice Architecture |
|
|
360 | (1) |
|
Docker and Visual Studio 2017 |
|
|
360 | (2) |
|
|
362 | (1) |
|
Chapter 16 Migration and Adoption Strategies |
|
|
363 | (16) |
|
In Search of Business Value |
|
|
363 | (8) |
|
|
364 | (4) |
|
|
368 | (1) |
|
|
369 | (2) |
|
Outlining a Yellowfield Strategy |
|
|
371 | (6) |
|
Dealing with Missing Dependencies |
|
|
371 | (1) |
|
The .NET Portability Analyzer |
|
|
372 | (1) |
|
The Windows Compatibility Pack |
|
|
373 | (1) |
|
Postponing the Cross-platform Challenge |
|
|
374 | (1) |
|
Moving Towards a Microservice Architecture |
|
|
375 | (2) |
|
|
377 | (2) |
Index |
|
379 | |