Introduction |
|
xxxix | |
Part I: The C# Language |
|
|
Chapter 1 .NET Applications And Tools |
|
|
3 | (21) |
|
From .NET Framework to .NET Core to .NET |
|
|
3 | (1) |
|
|
4 | (5) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
9 | (1) |
|
|
9 | (1) |
|
Application Types and Technologies |
|
|
10 | (4) |
|
|
10 | (1) |
|
|
11 | (1) |
|
|
11 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
12 | (2) |
|
|
13 | (1) |
|
Infrastructure as a Service |
|
|
13 | (1) |
|
|
13 | (1) |
|
|
13 | (1) |
|
|
14 | (2) |
|
|
14 | (1) |
|
|
14 | (1) |
|
|
14 | (1) |
|
Visual Studio Professional |
|
|
15 | (1) |
|
|
15 | (1) |
|
|
15 | (1) |
|
|
15 | (1) |
|
|
15 | (1) |
|
|
16 | (1) |
|
|
16 | (7) |
|
|
16 | (1) |
|
|
17 | (1) |
|
Selecting the Framework and Language Versions |
|
|
18 | (1) |
|
|
18 | (1) |
|
|
19 | (1) |
|
Creating a Web Application |
|
|
20 | (1) |
|
Publishing the Application |
|
|
21 | (1) |
|
Self-Contained Deployments |
|
|
21 | (1) |
|
Creating a Single Executable |
|
|
22 | (1) |
|
|
22 | (1) |
|
|
22 | (1) |
|
|
23 | (1) |
|
|
24 | (35) |
|
|
25 | (5) |
|
|
25 | (1) |
|
|
26 | (1) |
|
|
27 | (1) |
|
Understanding Variable Scope |
|
|
27 | (1) |
|
|
28 | (1) |
|
Methods and Types with Top-Level Statements |
|
|
29 | (1) |
|
|
30 | (3) |
|
|
30 | (1) |
|
|
31 | (2) |
|
|
33 | (4) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
34 | (1) |
|
|
34 | (1) |
|
|
35 | (1) |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
37 | (7) |
|
|
37 | (1) |
|
Pattern Matching with the is Operator |
|
|
37 | (1) |
|
|
38 | (1) |
|
Pattern Matching with the switch Statement |
|
|
39 | (1) |
|
|
40 | (2) |
|
|
42 | (1) |
|
|
43 | (1) |
|
|
43 | (1) |
|
|
43 | (1) |
|
|
44 | (1) |
|
Organization with Namespaces |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
45 | (1) |
|
|
45 | (4) |
|
|
46 | (1) |
|
|
46 | (1) |
|
|
47 | (1) |
|
|
47 | (1) |
|
|
48 | (1) |
|
|
48 | (1) |
|
|
49 | (2) |
|
Internal Comments Within the Source Files |
|
|
49 | (1) |
|
|
49 | (2) |
|
C# Preprocessor Directives |
|
|
51 | (3) |
|
|
51 | (1) |
|
#if, #elif, #else, and #endif |
|
|
52 | (1) |
|
|
52 | (1) |
|
|
53 | (1) |
|
|
53 | (1) |
|
|
53 | (1) |
|
|
54 | (1) |
|
C# Programming Guidelines |
|
|
54 | (4) |
|
|
54 | (1) |
|
|
54 | (1) |
|
|
55 | (2) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
56 | (1) |
|
|
57 | (1) |
|
Use of Properties and Methods |
|
|
57 | (1) |
|
|
58 | (1) |
|
|
58 | (1) |
|
Chapter 3 Classes, Records, Structs, And Tuples |
|
|
59 | (36) |
|
|
60 | (1) |
|
Pass by Value or by Reference |
|
|
60 | (2) |
|
|
62 | (15) |
|
|
63 | (1) |
|
|
64 | (1) |
|
|
65 | (3) |
|
Auto-Implemented Properties |
|
|
65 | (1) |
|
Access Modifiers for Properties |
|
|
66 | (1) |
|
|
66 | (1) |
|
Expression-Bodied Properties |
|
|
66 | (1) |
|
Auto-Implemented Read-Only Properties |
|
|
67 | (1) |
|
|
67 | (1) |
|
|
68 | (4) |
|
|
68 | (1) |
|
Expression-Bodied Methods |
|
|
68 | (1) |
|
|
68 | (1) |
|
|
69 | (1) |
|
|
70 | (1) |
|
|
70 | (1) |
|
Variable Number of Arguments |
|
|
71 | (1) |
|
|
72 | (2) |
|
Expression Bodies with Constructors |
|
|
73 | (1) |
|
Calling Constructors from Other Constructors |
|
|
73 | (1) |
|
|
74 | (1) |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
75 | (1) |
|
|
76 | (1) |
|
|
77 | (2) |
|
|
77 | (1) |
|
|
77 | (1) |
|
|
78 | (1) |
|
Equality Comparison with Records |
|
|
78 | (1) |
|
|
79 | (1) |
|
|
79 | (1) |
|
|
80 | (3) |
|
|
83 | (3) |
|
|
83 | (1) |
|
|
84 | (1) |
|
|
84 | (1) |
|
|
85 | (1) |
|
|
86 | (2) |
|
Declaring and Initializing Tuples |
|
|
86 | (1) |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
88 | (1) |
|
|
88 | (1) |
|
|
89 | (3) |
|
Pattern Matching with Tuples |
|
|
89 | (2) |
|
|
91 | (1) |
|
|
92 | (2) |
|
|
94 | (1) |
|
Chapter 4 Object-Oriented Programming In C# |
|
|
95 | (24) |
|
|
96 | (1) |
|
|
96 | (8) |
|
|
97 | (2) |
|
|
99 | (1) |
|
Calling Base Versions of Methods |
|
|
100 | (1) |
|
Abstract Classes and Methods |
|
|
101 | (1) |
|
Sealed Classes and Methods |
|
|
102 | (1) |
|
Constructors of Derived Classes |
|
|
102 | (2) |
|
|
104 | (2) |
|
|
104 | (1) |
|
|
105 | (1) |
|
|
106 | (1) |
|
|
107 | (8) |
|
|
107 | (2) |
|
Dependency Injection with Interfaces |
|
|
109 | (2) |
|
Explicit and Implicit Implemented Interfaces |
|
|
111 | (1) |
|
Comparing Interfaces and Classes |
|
|
112 | (1) |
|
Default Interface Methods |
|
|
112 | (3) |
|
Avoiding Breaking Changes |
|
|
112 | (1) |
|
|
113 | (2) |
|
|
115 | (3) |
|
|
117 | (1) |
|
|
118 | (1) |
|
Chapter 5 Operators And Casts |
|
|
119 | (34) |
|
|
120 | (7) |
|
Compound Assignment Operators |
|
|
121 | (1) |
|
The Conditional-Expression Operator (?:) |
|
|
121 | (1) |
|
The checked and unchecked Operators |
|
|
122 | (1) |
|
|
123 | (1) |
|
|
124 | (1) |
|
|
124 | (1) |
|
|
124 | (1) |
|
|
125 | (1) |
|
The Null-Coalescing and Null-Coalescing Assignment Operators |
|
|
125 | (1) |
|
The Null-Conditional Operator |
|
|
126 | (1) |
|
|
127 | (5) |
|
|
129 | (1) |
|
Signed and Unsigned Numbers |
|
|
130 | (2) |
|
|
132 | (4) |
|
|
132 | (3) |
|
|
132 | (1) |
|
|
133 | (2) |
|
|
135 | (1) |
|
|
136 | (3) |
|
|
136 | (1) |
|
Operator Overloading with the Vector Type |
|
|
137 | (2) |
|
Comparing Objects for Equality |
|
|
139 | (3) |
|
Implementing Custom Indexers |
|
|
142 | (1) |
|
|
143 | (9) |
|
Implementing User-Defined Casts |
|
|
144 | (6) |
|
|
147 | (1) |
|
Casts Between Base and Derived Classes |
|
|
148 | (1) |
|
Boxing and Unboxing Casts |
|
|
149 | (1) |
|
|
150 | (2) |
|
|
152 | (1) |
|
|
153 | (24) |
|
Multiple Objects of the Same Type |
|
|
154 | (1) |
|
|
154 | (3) |
|
Array Declaration and Initialization |
|
|
154 | (1) |
|
|
155 | (1) |
|
|
156 | (1) |
|
|
157 | (1) |
|
|
158 | (1) |
|
|
159 | (4) |
|
|
159 | (1) |
|
|
160 | (1) |
|
|
160 | (3) |
|
|
163 | (1) |
|
|
163 | (4) |
|
|
164 | (1) |
|
|
164 | (1) |
|
|
164 | (3) |
|
Different Ways to Iterate Through Collections |
|
|
165 | (2) |
|
|
167 | (3) |
|
|
167 | (1) |
|
Changing Values Using Spans |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
170 | (2) |
|
Indices and the Hat Operator |
|
|
170 | (1) |
|
|
170 | (1) |
|
Efficiently Changing Array Content |
|
|
171 | (1) |
|
Indices and Ranges with Custom Collections |
|
|
172 | (1) |
|
|
172 | (2) |
|
|
173 | (1) |
|
Renting Memory from the Pool |
|
|
173 | (1) |
|
Returning Memory to the Pool |
|
|
174 | (1) |
|
|
174 | (2) |
|
|
176 | (1) |
|
Chapter 7 Delegates, Lambdas, And Events |
|
|
177 | (16) |
|
|
178 | (1) |
|
|
178 | (9) |
|
|
178 | (1) |
|
|
179 | (3) |
|
Passing Delegates to Methods |
|
|
182 | (1) |
|
Action T and Func T Delegates |
|
|
183 | (1) |
|
|
184 | (2) |
|
|
186 | (1) |
|
|
187 | (2) |
|
|
187 | (1) |
|
|
188 | (1) |
|
|
188 | (1) |
|
|
189 | (3) |
|
|
190 | (1) |
|
|
191 | (1) |
|
|
192 | (1) |
|
|
193 | (33) |
|
|
194 | (1) |
|
Collection Interfaces and Types |
|
|
194 | (1) |
|
|
195 | (11) |
|
|
196 | (1) |
|
|
197 | (1) |
|
|
197 | (1) |
|
|
198 | (1) |
|
|
198 | (1) |
|
|
198 | (1) |
|
|
199 | (1) |
|
|
200 | (2) |
|
|
202 | (1) |
|
|
202 | (4) |
|
|
206 | (2) |
|
|
208 | (1) |
|
|
209 | (2) |
|
|
211 | (7) |
|
|
212 | (1) |
|
|
212 | (1) |
|
|
213 | (4) |
|
|
217 | (1) |
|
|
217 | (1) |
|
|
218 | (2) |
|
|
220 | (2) |
|
|
222 | (3) |
|
Using Builders with Immutable Collections |
|
|
223 | (1) |
|
Immutable Collection Types and Interfaces |
|
|
224 | (1) |
|
Using LINQ with Immutable Arrays |
|
|
225 | (1) |
|
|
225 | (1) |
|
Chapter 9 Language Integrated Query |
|
|
226 | (37) |
|
|
227 | (6) |
|
|
227 | (2) |
|
|
229 | (1) |
|
|
230 | (1) |
|
|
231 | (2) |
|
|
233 | (23) |
|
|
234 | (1) |
|
|
235 | (1) |
|
|
236 | (1) |
|
|
236 | (1) |
|
|
237 | (2) |
|
|
239 | (1) |
|
Variables Within the LINQ Query |
|
|
240 | (1) |
|
Grouping with Nested Objects |
|
|
241 | (1) |
|
|
242 | (3) |
|
|
245 | (1) |
|
|
246 | (3) |
|
|
249 | (1) |
|
|
250 | (1) |
|
|
251 | (1) |
|
|
252 | (2) |
|
|
254 | (1) |
|
|
255 | (1) |
|
|
256 | (2) |
|
|
256 | (1) |
|
|
257 | (1) |
|
|
258 | (3) |
|
|
261 | (1) |
|
|
262 | (1) |
|
Chapter 10 Errors And Exceptions |
|
|
263 | (25) |
|
|
264 | (1) |
|
Predefined Exception Classes |
|
|
264 | (1) |
|
|
265 | (13) |
|
Exceptions and Performance |
|
|
268 | (1) |
|
Implementing Multiple Catch Blocks |
|
|
269 | (3) |
|
Catching Exceptions from Other Code |
|
|
272 | (1) |
|
System.Exception Properties |
|
|
272 | (1) |
|
|
273 | (1) |
|
|
273 | (5) |
|
Naively Rethrowing the Exception |
|
|
275 | (1) |
|
|
275 | (1) |
|
|
276 | (1) |
|
Using Filters to Add Functionality |
|
|
277 | (1) |
|
What Happens If an Exception Isn't Handled? |
|
|
278 | (1) |
|
User-Defined Exception Classes |
|
|
278 | (7) |
|
Catching the User-Defined Exceptions |
|
|
279 | (2) |
|
Throwing the User-Defined Exceptions |
|
|
281 | (3) |
|
Defining the User-Defined Exception Classes |
|
|
284 | (1) |
|
|
285 | (2) |
|
|
287 | (1) |
|
Chapter 11 Tasks And Asynchronous Programming |
|
|
288 | (19) |
|
Why Asynchronous Programming Is Important |
|
|
289 | (1) |
|
|
290 | (1) |
|
|
291 | (6) |
|
|
292 | (1) |
|
Calling an Asynchronous Method |
|
|
292 | (1) |
|
|
293 | (1) |
|
|
294 | (1) |
|
|
294 | (1) |
|
Using Multiple Asynchronous Methods |
|
|
295 | (1) |
|
Calling Asynchronous Methods Sequentially |
|
|
295 | (1) |
|
|
295 | (1) |
|
|
296 | (1) |
|
|
297 | (2) |
|
Handling Exceptions with Asynchronous Methods |
|
|
298 | (1) |
|
Handling Exceptions with Multiple Asynchronous Methods |
|
|
298 | (1) |
|
Using AggregateException Information |
|
|
299 | (1) |
|
Cancellation of async Methods |
|
|
299 | (1) |
|
|
300 | (2) |
|
|
302 | (4) |
|
|
303 | (1) |
|
|
304 | (1) |
|
|
305 | (1) |
|
|
305 | (1) |
|
|
306 | (1) |
|
Chapter 12 Reflection, Metadata, And Source Generators |
|
|
307 | (28) |
|
Inspecting Code at Runtime and Dynamic Programming |
|
|
308 | (1) |
|
|
308 | (6) |
|
Writing Custom Attributes |
|
|
309 | (3) |
|
Specifying the AttributeUsage Attribute |
|
|
310 | (1) |
|
Specifying Attribute Parameters |
|
|
311 | (1) |
|
Specifying Optional Attribute Parameters |
|
|
311 | (1) |
|
Custom Attribute Example: WhatsNewAttributes |
|
|
312 | (2) |
|
The WhatsNewAttributes Library |
|
|
312 | (1) |
|
|
313 | (1) |
|
|
314 | (8) |
|
|
314 | (2) |
|
|
315 | (1) |
|
|
316 | (1) |
|
|
316 | (2) |
|
|
318 | (1) |
|
Getting Details About Types Defined in an Assembly |
|
|
318 | (1) |
|
Getting Details About Custom Attributes |
|
|
319 | (1) |
|
Completing the WhatsNewAttributes Example |
|
|
319 | (3) |
|
Using Dynamic Language Extensions for Reflection |
|
|
322 | (3) |
|
Creating the Calculator Library |
|
|
322 | (1) |
|
Instantiating a Type Dynamically |
|
|
323 | (1) |
|
Invoking a Member with the Reflection API |
|
|
323 | (1) |
|
Invoking a Member with the Dynamic Type |
|
|
324 | (1) |
|
|
325 | (2) |
|
|
327 | (7) |
|
Hello, World Source Generator |
|
|
328 | (2) |
|
Source Generators Using Partial Methods |
|
|
330 | (4) |
|
|
334 | (1) |
|
Chapter 13 Managed And Unmanaged Memory |
|
|
335 | (42) |
|
|
336 | (1) |
|
Memory Management Under the Hood |
|
|
336 | (6) |
|
|
336 | (2) |
|
|
338 | (2) |
|
|
340 | (2) |
|
Strong and Weak References |
|
|
342 | (2) |
|
Working with Unmanaged Resources |
|
|
344 | (5) |
|
Destructors or Finalizers |
|
|
344 | (1) |
|
The !Disposable and lAsyncDiposable Interfaces |
|
|
345 | (1) |
|
The using Statement and the using Declaration |
|
|
346 | (1) |
|
Implementing IDisposable and a Destructor |
|
|
347 | (1) |
|
IDisposable and Finalizer Rules |
|
|
348 | (1) |
|
|
349 | (16) |
|
Accessing Memory Directly with Pointers |
|
|
349 | (1) |
|
Writing Unsafe Code with the unsafe Keyword |
|
|
350 | (1) |
|
|
351 | (1) |
|
Casting Pointers to Integer Types |
|
|
352 | (1) |
|
Casting Between Pointer Types |
|
|
353 | (1) |
|
|
353 | (1) |
|
|
353 | (2) |
|
|
355 | (1) |
|
Pointers to Structs: The Pointer Member Access Operator |
|
|
355 | (1) |
|
Pointers to Class Members |
|
|
356 | (1) |
|
Pointer Example: PointerPlayground |
|
|
357 | (4) |
|
|
361 | (1) |
|
Using Pointers to Optimize Performance |
|
|
362 | (3) |
|
Creating Stack-Based Arrays |
|
|
362 | (2) |
|
|
364 | (1) |
|
|
365 | (3) |
|
Spans Referencing the Managed Heap |
|
|
365 | (1) |
|
Spans Referencing the Stack |
|
|
366 | (1) |
|
Spans Referencing the Native Heap |
|
|
366 | (1) |
|
|
367 | (1) |
|
|
368 | (5) |
|
Calling Native Windows APIs |
|
|
368 | (3) |
|
Calling Native Linux APIs |
|
|
371 | (2) |
|
Using the Library for Calling Native APIs |
|
|
373 | (1) |
|
|
373 | (4) |
Part II: Libraries |
|
|
Chapter 14 Libraries, Assemblies, Packages, And Nuget |
|
|
377 | (15) |
|
|
378 | (1) |
|
|
379 | (2) |
|
Creating and Using Libraries |
|
|
381 | (5) |
|
|
381 | (1) |
|
|
382 | (1) |
|
|
383 | (1) |
|
|
383 | (1) |
|
Referencing NuGet Packages |
|
|
384 | (1) |
|
|
384 | (2) |
|
|
386 | (4) |
|
NuGet Packages with the Command Line |
|
|
386 | (1) |
|
Supporting Multiple Platforms |
|
|
387 | (2) |
|
NuGet Packages with Visual Studio |
|
|
389 | (1) |
|
|
390 | (1) |
|
|
391 | (1) |
|
Chapter 15 Dependency Injection And Configuration |
|
|
392 | (27) |
|
What Is Dependency Injection? |
|
|
393 | (1) |
|
Using the .NET DI Container |
|
|
393 | (2) |
|
|
395 | (1) |
|
|
396 | (7) |
|
Singleton and Transient Services |
|
|
398 | (2) |
|
|
400 | (3) |
|
|
403 | (1) |
|
Initialization of Services Using Options |
|
|
403 | (2) |
|
Using Configuration Files |
|
|
405 | (1) |
|
Configuration with .NET Applications |
|
|
406 | (5) |
|
|
407 | (1) |
|
Reading Strongly Typed Values |
|
|
408 | (1) |
|
|
408 | (1) |
|
Production and Development Settings |
|
|
409 | (1) |
|
|
410 | (1) |
|
|
411 | (7) |
|
Creating Azure App Configuration |
|
|
411 | (1) |
|
Using Azure App Configuration in the Development Environment |
|
|
412 | (2) |
|
|
414 | (1) |
|
Production and Staging Settings with Azure App Configuration |
|
|
415 | (1) |
|
|
415 | (2) |
|
Using the Azure Key Vault |
|
|
417 | (1) |
|
|
418 | (1) |
|
Chapter 16 Diagnostics And Metrics |
|
|
419 | (21) |
|
|
420 | (1) |
|
|
421 | (8) |
|
|
424 | (2) |
|
|
426 | (1) |
|
|
426 | (1) |
|
Logging and Tracing with OpenTelemetry |
|
|
427 | (2) |
|
|
429 | (1) |
|
|
429 | (5) |
|
|
429 | (1) |
|
|
430 | (2) |
|
Using MetricsSampleSource |
|
|
432 | (1) |
|
Monitoring Metrics with .NET CLI |
|
|
433 | (1) |
|
Analytics with Visual Studio App Center |
|
|
434 | (3) |
|
|
437 | (2) |
|
|
439 | (1) |
|
Chapter 17 Parallel Programming |
|
|
440 | (45) |
|
|
441 | (1) |
|
|
442 | (6) |
|
Looping with the Parallel.For Method |
|
|
443 | (2) |
|
Stopping Parallel.For Early |
|
|
445 | (1) |
|
Parallel.For Initialization |
|
|
446 | (1) |
|
Looping with the Parallel.ForEach Method |
|
|
447 | (1) |
|
Invoking Multiple Methods with the Parallel.Invoke Method |
|
|
447 | (1) |
|
|
448 | (7) |
|
|
448 | (2) |
|
Tasks Using the Thread Pool |
|
|
449 | (1) |
|
|
450 | (1) |
|
Tasks Using a Separate Thread |
|
|
450 | (1) |
|
|
450 | (1) |
|
|
451 | (1) |
|
|
452 | (1) |
|
Returning Tasks from Methods |
|
|
453 | (1) |
|
|
453 | (1) |
|
|
453 | (2) |
|
|
455 | (3) |
|
Cancellation of Parallel.For |
|
|
455 | (2) |
|
|
457 | (1) |
|
|
458 | (3) |
|
Creating Bounded and Unbounded Channels |
|
|
458 | (1) |
|
|
459 | (1) |
|
|
460 | (1) |
|
Async Streaming with the Channel |
|
|
460 | (1) |
|
|
461 | (2) |
|
|
461 | (1) |
|
|
461 | (2) |
|
|
463 | (5) |
|
|
464 | (2) |
|
|
466 | (2) |
|
|
468 | (1) |
|
|
468 | (1) |
|
|
469 | (1) |
|
|
470 | (1) |
|
|
470 | (1) |
|
|
471 | (2) |
|
|
473 | (3) |
|
|
476 | (3) |
|
|
479 | (2) |
|
|
481 | (3) |
|
|
484 | (1) |
|
Chapter 18 Files And Streams |
|
|
485 | (35) |
|
|
486 | (1) |
|
|
486 | (6) |
|
Checking Drive Information |
|
|
487 | (1) |
|
Working with the Path Class |
|
|
488 | (1) |
|
Creating Files and Folders |
|
|
488 | (2) |
|
Accessing and Modifying File Properties |
|
|
490 | (1) |
|
Using File to Read and Write |
|
|
491 | (1) |
|
|
492 | (1) |
|
|
493 | (10) |
|
Working with File Streams |
|
|
495 | (3) |
|
|
496 | (1) |
|
Getting Stream Information |
|
|
496 | (1) |
|
Analyzing Text File Encodings |
|
|
497 | (1) |
|
|
498 | (1) |
|
|
499 | (1) |
|
|
499 | (1) |
|
Using Random Access to Streams |
|
|
500 | (2) |
|
|
502 | (1) |
|
Using Readers and Writers |
|
|
503 | (2) |
|
|
503 | (1) |
|
|
504 | (1) |
|
Reading and Writing Binary Files |
|
|
505 | (1) |
|
|
505 | (3) |
|
|
506 | (1) |
|
|
507 | (1) |
|
|
507 | (1) |
|
|
508 | (1) |
|
|
509 | (6) |
|
|
510 | (2) |
|
|
512 | (1) |
|
|
513 | (1) |
|
|
513 | (1) |
|
|
514 | (1) |
|
Using Files and Streams with the Windows Runtime |
|
|
515 | (4) |
|
|
515 | (3) |
|
Mapping Windows Runtime Types to .NET Types |
|
|
518 | (1) |
|
|
519 | (1) |
|
|
520 | (38) |
|
|
521 | (1) |
|
Working with Utility Classes |
|
|
521 | (5) |
|
|
522 | (1) |
|
|
523 | (1) |
|
|
524 | (1) |
|
|
524 | (2) |
|
|
526 | (1) |
|
|
526 | (7) |
|
TCP Echo Sample Using Sockets |
|
|
526 | (2) |
|
|
528 | (2) |
|
Communication with Pipelines |
|
|
530 | (2) |
|
|
532 | (1) |
|
|
533 | (4) |
|
|
533 | (2) |
|
|
535 | (2) |
|
|
537 | (5) |
|
|
537 | (2) |
|
|
539 | (2) |
|
|
541 | (1) |
|
|
542 | (6) |
|
|
543 | (1) |
|
|
544 | (1) |
|
|
545 | (3) |
|
|
548 | (6) |
|
Making an Asynchronous Get Request |
|
|
549 | (1) |
|
Throwing Exceptions from Errors |
|
|
550 | (1) |
|
Creating an HttpRequestMessage |
|
|
551 | (1) |
|
|
551 | (2) |
|
|
553 | (1) |
|
Customizing Requests with HttpMessageHandler |
|
|
553 | (1) |
|
|
554 | (3) |
|
|
555 | (1) |
|
|
555 | (1) |
|
|
556 | (1) |
|
|
557 | (1) |
|
|
558 | (24) |
|
|
559 | (1) |
|
Verifying User Information |
|
|
559 | (7) |
|
Working with the Microsoft Identity Platform |
|
|
559 | (1) |
|
Using Microsoft.Identity.Client |
|
|
560 | (3) |
|
Using Authentication and Authorization with a Web App |
|
|
563 | (3) |
|
|
566 | (10) |
|
Getting an X.509 Certificate |
|
|
569 | (2) |
|
Creating and Verifying a Signature |
|
|
571 | (2) |
|
Implementing Secure Data Exchange |
|
|
573 | (3) |
|
|
576 | (5) |
|
|
576 | (2) |
|
|
578 | (1) |
|
Protecting Against Cross-Site Request Forgery |
|
|
579 | (2) |
|
|
581 | (1) |
|
Chapter 21 Entity Framework Core |
|
|
582 | (62) |
|
|
583 | (10) |
|
|
583 | (1) |
|
Creating an Azure SQL Database |
|
|
583 | (1) |
|
|
584 | (1) |
|
|
585 | (1) |
|
Conventions, Annotations, and Fluent API |
|
|
586 | (1) |
|
Configuring the Context with the DI Provider |
|
|
587 | (1) |
|
|
588 | (1) |
|
|
588 | (1) |
|
|
589 | (1) |
|
Reading from the Database |
|
|
589 | (1) |
|
|
590 | (1) |
|
|
591 | (1) |
|
|
591 | (1) |
|
|
592 | (1) |
|
|
593 | (7) |
|
|
593 | (1) |
|
Using the Fluent API for Mapping Definitions |
|
|
594 | (1) |
|
Using Self-Contained Type Configuration |
|
|
595 | (2) |
|
|
597 | (1) |
|
Working with Shadow Properties |
|
|
598 | (2) |
|
Scaffolding a Model from the Database |
|
|
600 | (1) |
|
|
601 | (5) |
|
Implementing IDesignTimeDbContextFactory |
|
|
601 | (1) |
|
|
602 | (3) |
|
Applying Migrations Programmatically |
|
|
605 | (1) |
|
Other Ways to Apply Migrations |
|
|
606 | (1) |
|
|
606 | (6) |
|
|
606 | (3) |
|
|
609 | (1) |
|
|
609 | (1) |
|
|
609 | (2) |
|
|
611 | (1) |
|
|
612 | (1) |
|
|
612 | (5) |
|
Eager Loading Related Data |
|
|
613 | (1) |
|
Eager Loading with Filtered Include |
|
|
613 | (1) |
|
Explicit Loading Related Data |
|
|
614 | (1) |
|
|
615 | (2) |
|
Working with Relationships |
|
|
617 | (8) |
|
|
617 | (2) |
|
|
619 | (2) |
|
|
621 | (2) |
|
|
623 | (2) |
|
|
625 | (5) |
|
Adding Objects with Relations |
|
|
626 | (1) |
|
|
627 | (2) |
|
|
629 | (1) |
|
Updating Untracked Objects |
|
|
629 | (1) |
|
|
630 | (5) |
|
|
631 | (1) |
|
|
632 | (3) |
|
|
635 | (4) |
|
Using Implicit Transactions |
|
|
635 | (1) |
|
Creating Explicit Transactions |
|
|
636 | (1) |
|
Using Ambient Transactions |
|
|
637 | (2) |
|
|
639 | (4) |
|
|
643 | (1) |
|
|
644 | (24) |
|
|
645 | (1) |
|
Namespace System.Globalization |
|
|
645 | (11) |
|
|
645 | (1) |
|
|
646 | (3) |
|
Specific, Neutral, and Invariant Cultures |
|
|
646 | (1) |
|
Current Culture and Current UI Culture |
|
|
647 | (1) |
|
|
647 | (1) |
|
|
648 | (1) |
|
|
649 | (5) |
|
|
654 | (2) |
|
|
656 | (2) |
|
Resource Readers and Writers |
|
|
657 | (1) |
|
Using Resource Files with ResourceManager |
|
|
657 | (1) |
|
Localization with ASP.NET Core |
|
|
658 | (6) |
|
Registering Localization Services |
|
|
659 | (1) |
|
Configuring the Middleware |
|
|
659 | (1) |
|
ASP.NET Core Culture Providers |
|
|
660 | (1) |
|
Using a Culture with ASP.NET Core |
|
|
661 | (1) |
|
Using Resources with ASP.NET Core |
|
|
661 | (2) |
|
Localization with Data Annotations |
|
|
663 | (1) |
|
|
664 | (3) |
|
Using the MRT ResourceLoader |
|
|
665 | (1) |
|
Using the MRT ResourceManager |
|
|
666 | (1) |
|
Changing the Language with a ResourceContext |
|
|
666 | (1) |
|
|
667 | (1) |
|
|
668 | (19) |
|
|
668 | (1) |
|
|
669 | (9) |
|
|
669 | (2) |
|
|
671 | (1) |
|
Implementing Complex Methods |
|
|
671 | (1) |
|
|
672 | (1) |
|
|
673 | (1) |
|
|
674 | (1) |
|
|
675 | (3) |
|
|
678 | (4) |
|
ASP.NET Core Integration Testing |
|
|
682 | (2) |
|
|
684 | (3) |
Part III: Web Applications And Services |
|
|
|
687 | (27) |
|
Understanding Web Technologies |
|
|
687 | (2) |
|
|
688 | (1) |
|
|
688 | (1) |
|
JavaScript and TypeScript |
|
|
688 | (1) |
|
|
689 | (1) |
|
|
689 | (1) |
|
Creating an ASP.NET Core Web Project |
|
|
689 | (5) |
|
|
691 | (1) |
|
|
692 | (1) |
|
Sample Application Preparations |
|
|
693 | (1) |
|
Adding Client-Side Content |
|
|
694 | (2) |
|
Creating Custom Middleware |
|
|
696 | (3) |
|
|
699 | (1) |
|
|
699 | (1) |
|
|
700 | (1) |
|
|
700 | (6) |
|
|
701 | (2) |
|
|
703 | (1) |
|
|
704 | (1) |
|
|
705 | (1) |
|
|
706 | (1) |
|
|
706 | (2) |
|
|
708 | (3) |
|
|
711 | (2) |
|
|
713 | (1) |
|
|
714 | (38) |
|
Understanding Today's Services |
|
|
715 | (1) |
|
REST Services with ASP.NET Core |
|
|
715 | (9) |
|
|
716 | (1) |
|
|
716 | (4) |
|
|
720 | (2) |
|
|
722 | (1) |
|
REST Results and Status Codes |
|
|
723 | (1) |
|
|
724 | (6) |
|
|
725 | (3) |
|
|
728 | (1) |
|
|
728 | (1) |
|
|
729 | (1) |
|
Using EF Core with Services |
|
|
730 | (2) |
|
Authentication and Authorization with Azure AD B2C |
|
|
732 | (8) |
|
Creating and Configuring the Service |
|
|
734 | (4) |
|
Adding Authentication to the Client Application |
|
|
738 | (2) |
|
Implementing and Using Services with GRPC |
|
|
740 | (8) |
|
|
740 | (1) |
|
Defining the Contract with Protobuf |
|
|
741 | (1) |
|
Implementing a gRPC Service |
|
|
742 | (2) |
|
Implementing a gRPC Client |
|
|
744 | (2) |
|
|
746 | (2) |
|
|
748 | (3) |
|
Creating an Azure Functions Project |
|
|
748 | (1) |
|
Adding HTTP Trigger Functions |
|
|
749 | (2) |
|
|
751 | (1) |
|
|
751 | (1) |
|
Chapter 26 Razor Pages And MVC |
|
|
752 | (27) |
|
Setting Up Services for Razor Pages and MVC |
|
|
753 | (2) |
|
Creating Razor Pages Projects |
|
|
753 | (1) |
|
Understanding Razor Syntax |
|
|
754 | (1) |
|
|
755 | (18) |
|
|
756 | (1) |
|
Passing Data Between Views |
|
|
757 | (1) |
|
|
757 | (1) |
|
|
758 | (2) |
|
Razor Libraries and Areas |
|
|
760 | (1) |
|
|
761 | (1) |
|
|
761 | (1) |
|
|
762 | (1) |
|
Working with HTML Helpers |
|
|
762 | (1) |
|
|
763 | (1) |
|
|
764 | (1) |
|
Creating Custom Tag Helpers |
|
|
765 | (2) |
|
Creating Elements with Tag Helpers |
|
|
767 | (3) |
|
|
770 | (3) |
|
|
773 | (5) |
|
|
773 | (1) |
|
|
773 | (1) |
|
|
774 | (1) |
|
|
775 | (2) |
|
|
775 | (1) |
|
|
776 | (1) |
|
|
777 | (1) |
|
|
778 | (1) |
|
|
779 | (22) |
|
Blazor Server and Blazor WebAssembly |
|
|
780 | (2) |
|
|
780 | (1) |
|
|
780 | (1) |
|
|
781 | (1) |
|
Creating a Blazor Server Web Application |
|
|
782 | (6) |
|
|
782 | (1) |
|
|
783 | (1) |
|
|
784 | (1) |
|
|
785 | (1) |
|
|
786 | (2) |
|
|
788 | (4) |
|
Blazor WebAssembly Startup |
|
|
789 | (1) |
|
Injecting HttpClient with Blazor WebAssembly |
|
|
790 | (1) |
|
Working with Progressive Web Applications |
|
|
791 | (1) |
|
|
792 | (8) |
|
Understanding the Parameters of Components |
|
|
792 | (1) |
|
|
793 | (1) |
|
Working with Event Callback |
|
|
794 | (2) |
|
Programmatically Updating the UI |
|
|
796 | (1) |
|
|
796 | (1) |
|
|
797 | (1) |
|
Using Templated Components |
|
|
798 | (1) |
|
Using Built-in Components |
|
|
799 | (1) |
|
|
800 | (1) |
|
|
801 | (18) |
|
|
801 | (1) |
|
Creating a Simple Chat Using SignaIR |
|
|
802 | (8) |
|
|
802 | (2) |
|
Creating a Client with HTML and JavaScript |
|
|
804 | (2) |
|
Creating SignaIR .NET Clients |
|
|
806 | (4) |
|
|
810 | (4) |
|
Extending the Hub with Groups |
|
|
810 | (1) |
|
Extending the Windows Client App with Groups |
|
|
811 | (3) |
|
|
814 | (2) |
|
|
816 | (3) |
Part IV: APPS |
|
|
|
819 | (57) |
|
|
819 | (7) |
|
|
821 | (1) |
|
|
822 | (1) |
|
|
822 | (1) |
|
|
822 | (2) |
|
|
824 | (2) |
|
|
826 | (11) |
|
Mapping Elements to Classes |
|
|
826 | (1) |
|
Using Custom .NET Classes with XAML |
|
|
827 | (1) |
|
Setting Properties as Attributes |
|
|
828 | (1) |
|
Using Properties as Elements |
|
|
829 | (1) |
|
|
829 | (1) |
|
Creating a Dependency Property |
|
|
830 | (1) |
|
Value Changed Callbacks and Events |
|
|
831 | (1) |
|
|
832 | (1) |
|
|
833 | (2) |
|
|
835 | (1) |
|
|
836 | (1) |
|
|
837 | (15) |
|
FrameworkElement-Derived UI Elements |
|
|
838 | (2) |
|
|
840 | (1) |
|
|
840 | (7) |
|
|
843 | (1) |
|
|
843 | (4) |
|
|
847 | (2) |
|
|
848 | (1) |
|
|
848 | (1) |
|
|
849 | (1) |
|
|
850 | (1) |
|
Replacing the Content of the Button |
|
|
850 | (1) |
|
Linking with the HyperlinkButton |
|
|
851 | (1) |
|
|
851 | (1) |
|
|
852 | (1) |
|
Working with Data Binding |
|
|
852 | (9) |
|
Change Notification with INotifyPropertyChanged |
|
|
853 | (2) |
|
|
855 | (1) |
|
|
856 | (1) |
|
Binding Events to Methods |
|
|
856 | (1) |
|
Using Data Templates and the Data Template Selector |
|
|
857 | (1) |
|
|
858 | (1) |
|
|
859 | (1) |
|
|
860 | (1) |
|
|
861 | (6) |
|
|
862 | (2) |
|
|
864 | (1) |
|
|
865 | (2) |
|
Implementing Layout Panels |
|
|
867 | (8) |
|
|
867 | (1) |
|
|
868 | (1) |
|
|
869 | (1) |
|
|
870 | (2) |
|
|
872 | (2) |
|
|
874 | (1) |
|
|
875 | (1) |
|
Chapter 30 Patterns With XAML APPS |
|
|
876 | (23) |
|
|
876 | (1) |
|
|
877 | (2) |
|
|
879 | (1) |
|
|
879 | (3) |
|
|
882 | (1) |
|
|
883 | (8) |
|
|
886 | (1) |
|
Concrete View Model Implementations |
|
|
887 | (1) |
|
|
888 | (1) |
|
Services, View Models, and Dependency Injection |
|
|
889 | (2) |
|
|
891 | (6) |
|
Opening Dialogs from View Models |
|
|
893 | (1) |
|
|
894 | (3) |
|
|
897 | (1) |
|
|
898 | (1) |
|
Chapter 31 Styling Windows APPS |
|
|
899 | (34) |
|
|
900 | (1) |
|
|
900 | (2) |
|
|
902 | (1) |
|
Geometries Using Segments |
|
|
902 | (1) |
|
Geometries Using Path Markup |
|
|
903 | (1) |
|
|
903 | (3) |
|
|
904 | (1) |
|
|
904 | (1) |
|
|
905 | (1) |
|
|
905 | (1) |
|
Transforming with Groups and Composite Transforms |
|
|
905 | (1) |
|
Transforming Using a Matrix |
|
|
905 | (1) |
|
|
906 | (2) |
|
|
906 | (1) |
|
|
907 | (1) |
|
|
907 | (1) |
|
|
908 | (1) |
|
|
908 | (5) |
|
|
908 | (2) |
|
|
910 | (1) |
|
|
911 | (2) |
|
|
913 | (5) |
|
|
913 | (2) |
|
|
915 | (2) |
|
|
917 | (1) |
|
|
917 | (1) |
|
|
918 | (10) |
|
|
918 | (2) |
|
|
920 | (5) |
|
|
925 | (1) |
|
|
926 | (2) |
|
|
926 | (1) |
|
|
926 | (1) |
|
|
927 | (1) |
|
|
928 | (3) |
|
Predefined States with Control Templates |
|
|
929 | (1) |
|
|
930 | (1) |
|
|
931 | (1) |
|
|
931 | (2) |
Index |
|
933 | |