Muutke küpsiste eelistusi

Professional C# and .NET 2021 Edition [Pehme köide]

  • Formaat: Paperback / softback, 1008 pages, kõrgus x laius x paksus: 234x188x51 mm, kaal: 1656 g
  • Ilmumisaeg: 21-Jan-2022
  • Kirjastus: Wrox Press
  • ISBN-10: 1119797209
  • ISBN-13: 9781119797203
Teised raamatud teemal:
  • Pehme köide
  • Hind: 59,75 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Tavahind: 70,30 €
  • Säästad 15%
  • Raamatu kohalejõudmiseks kirjastusest kulub orienteeruvalt 2-4 nädalat
  • Kogus:
  • Lisa ostukorvi
  • Tasuta tarne
  • Tellimisaeg 2-4 nädalat
  • Lisa soovinimekirja
  • Formaat: Paperback / softback, 1008 pages, kõrgus x laius x paksus: 234x188x51 mm, kaal: 1656 g
  • Ilmumisaeg: 21-Jan-2022
  • Kirjastus: Wrox Press
  • ISBN-10: 1119797209
  • ISBN-13: 9781119797203
Teised raamatud teemal:

Get the latest coverage of the newest features in C#9 and .NET 5 

In Professional C# and .NET: 2021 Edition, Microsoft MVP for Visual Studio and Development Technologies and veteran developer, Christian Nagel, delivers a comprehensive tour of the new features and capabilities of C#9 and .NET 5. 

Experienced programmers making the transition to C# will benefit from the author’s in-depth explorations to create Web- and Windows applications using ASP.NET Core, Blazor, and WinUI using modern application patterns and new features offered by .NET including Microservices deployed to Docker images, GRPC, localization, asynchronous streaming, and much more.  

The book also offers: 

  • Discussions of the extension of .NET to non-Microsoft platforms like OSX and Linux 
  • Explanations of the newest features in C#9, including support for record types,  and enhanced support for tuples, pattern matching, and nullable reference types 
  • Integrating .NET applications with Microsoft Azure services such as Azure App Configuration, Azure Key Vault, Azure Functions, the Azure Active Directory, and others 
  • Downloadable code examples from wrox.com and github.com with online updates for C# 10 and .NET 6 

Perfect for programmers with a background in C#, Visual Basic, Java, or C/C++, Professional C# and .NET: 2021 Edition will also earn a place in the libraries of software architects seeking an up-to-date and fulsome treatment of the latest C# and .NET releases. 

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)
.NET Terms
4(5)
.NET SDK
4(1)
.NET Runtime
5(1)
Common Language Runtime
6(1)
.NET Compiler Platform
6(1)
.NET Framework
6(1)
.NET Core
6(1)
.NET
7(1)
.NET Standard
7(1)
NuGet Packages
8(1)
Namespaces
9(1)
.NET Support Length
9(1)
Application Types and Technologies
10(4)
Data Access
10(1)
Windows Apps
11(1)
Web Applications
11(1)
Services
12(1)
SignalR
12(1)
Microsoft Azure
12(2)
Software as a Service
13(1)
Infrastructure as a Service
13(1)
Platform as a Service
13(1)
Functions as a Service
13(1)
Developer Tools
14(2)
.NET CLI
14(1)
Visual Studio Code
14(1)
Visual Studio Community
14(1)
Visual Studio Professional
15(1)
Visual Studio Enterprise
15(1)
Visual Studio for Mac
15(1)
Windows Terminal
15(1)
WSL 2
15(1)
Docker Desktop
16(1)
Using the .NET CLI
16(7)
Creating the Application
16(1)
Top-Level Statements
17(1)
Selecting the Framework and Language Versions
18(1)
Building the Application
18(1)
Running the Application
19(1)
Creating a Web Application
20(1)
Publishing the Application
21(1)
Self-Contained Deployments
21(1)
Creating a Single Executable
22(1)
ReadyToRun
22(1)
Trimming
22(1)
Summary
23(1)
Chapter 2 Core C#
24(35)
Fundamentals of C#
25(5)
Top-Level Statements
25(1)
Variables
26(1)
Command-Line Arguments
27(1)
Understanding Variable Scope
27(1)
Constants
28(1)
Methods and Types with Top-Level Statements
29(1)
Nullable Types
30(3)
Nullable Value Types
30(1)
Nullable Reference Types
31(2)
Using Predefined Types
33(4)
Integer Types
33(1)
Big Integer
33(1)
Native Integer Types
33(1)
Digit Separators
34(1)
Binary Values
34(1)
Floating-Point Types
34(1)
The Boolean Type
35(1)
The Character Type
35(1)
Literals for Numbers
36(1)
The object Type
36(1)
Controlling Program Flow
37(7)
The if Statement
37(1)
Pattern Matching with the is Operator
37(1)
The switch Statement
38(1)
Pattern Matching with the switch Statement
39(1)
The switch Expression
40(2)
The for Loop
42(1)
The while Loop
43(1)
The do-while Loop
43(1)
The foreach Loop
43(1)
Exiting Loops
44(1)
Organization with Namespaces
44(1)
The using Directive
45(1)
Namespace Aliases
45(1)
Working with Strings
45(4)
Using the StringBuilder
46(1)
String Interpolation
46(1)
FormattableString
47(1)
String Formats
47(1)
Verbatim Strings
48(1)
Ranges with Strings
48(1)
Comments
49(2)
Internal Comments Within the Source Files
49(1)
XML Documentation
49(2)
C# Preprocessor Directives
51(3)
#define and #undef
51(1)
#if, #elif, #else, and #endif
52(1)
#warning and #error
52(1)
#region and #endregion
53(1)
#line
53(1)
#pragma
53(1)
#nullable
54(1)
C# Programming Guidelines
54(4)
Rules for Identifiers
54(1)
Usage Conventions
54(1)
Naming Conventions
55(2)
Casing of Names
55(1)
Name Styles
56(1)
Namespace Names
56(1)
Names and Keywords
57(1)
Use of Properties and Methods
57(1)
Use of Fields
58(1)
Summary
58(1)
Chapter 3 Classes, Records, Structs, And Tuples
59(36)
Creating and Using Types
60(1)
Pass by Value or by Reference
60(2)
Classes
62(15)
Fields
63(1)
Readonly Fields
64(1)
Properties
65(3)
Auto-Implemented Properties
65(1)
Access Modifiers for Properties
66(1)
Readonly Properties
66(1)
Expression-Bodied Properties
66(1)
Auto-Implemented Read-Only Properties
67(1)
Init-Only Set Accessors
67(1)
Methods
68(4)
Declaring Methods
68(1)
Expression-Bodied Methods
68(1)
Invoking Methods
68(1)
Method Overloading
69(1)
Named Arguments
70(1)
Optional Arguments
70(1)
Variable Number of Arguments
71(1)
Constructors
72(2)
Expression Bodies with Constructors
73(1)
Calling Constructors from Other Constructors
73(1)
Static Constructors
74(1)
Local Functions
74(1)
Generic Methods
75(1)
Extension Methods
75(1)
Anonymous Types
76(1)
Records
77(2)
Immutable Types
77(1)
Nominal Records
77(1)
Positional Records
78(1)
Equality Comparison with Records
78(1)
With Expressions
79(1)
Structs
79(1)
Enum Types
80(3)
ref, in, and out
83(3)
ref Parameters
83(1)
in Parameters
84(1)
ref return
84(1)
out Parameters
85(1)
Tuples
86(2)
Declaring and Initializing Tuples
86(1)
Tuple Deconstruction
87(1)
Returning Tuples
88(1)
ValueTuple
88(1)
Deconstruction
88(1)
Pattern Matching
89(3)
Pattern Matching with Tuples
89(2)
Property Pattern
91(1)
Partial Types
92(2)
Summary
94(1)
Chapter 4 Object-Oriented Programming In C#
95(24)
Object Orientation
96(1)
Inheritance with Classes
96(8)
Virtual Methods
97(2)
Hiding Methods
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)
Modifiers
104(2)
Access Modifiers
104(1)
Other Modifiers
105(1)
Inheritance with Records
106(1)
Using Interfaces
107(8)
Predefined Interfaces
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)
Traits with C#
113(2)
Generics
115(3)
Constraints
117(1)
Summary
118(1)
Chapter 5 Operators And Casts
119(34)
Operators
120(7)
Compound Assignment Operators
121(1)
The Conditional-Expression Operator (?:)
121(1)
The checked and unchecked Operators
122(1)
The is and as Operators
123(1)
The sizeof Operator
124(1)
The typeof Operator
124(1)
The nameof Expression
124(1)
The Indexer
125(1)
The Null-Coalescing and Null-Coalescing Assignment Operators
125(1)
The Null-Conditional Operator
126(1)
Using Binary Operators
127(5)
Shifting Bits
129(1)
Signed and Unsigned Numbers
130(2)
Type Safety
132(4)
Type Conversions
132(3)
Implicit Conversions
132(1)
Explicit Conversions
133(2)
Boxing and Unboxing
135(1)
Operator Overloading
136(3)
How Operators Work
136(1)
Operator Overloading with the Vector Type
137(2)
Comparing Objects for Equality
139(3)
Implementing Custom Indexers
142(1)
User-Defined Conversions
143(9)
Implementing User-Defined Casts
144(6)
Casts Between Classes
147(1)
Casts Between Base and Derived Classes
148(1)
Boxing and Unboxing Casts
149(1)
Multiple Casting
150(2)
Summary
152(1)
Chapter 6 Arrays
153(24)
Multiple Objects of the Same Type
154(1)
Simple Arrays
154(3)
Array Declaration and Initialization
154(1)
Accessing Array Elements
155(1)
Using Reference Types
156(1)
Multidimensional Arrays
157(1)
Jagged Arrays
158(1)
Array Class
159(4)
Creating Arrays
159(1)
Copying Arrays
160(1)
Sorting
160(3)
Arrays as Parameters
163(1)
Enumerators
163(4)
IEnumerator Interface
164(1)
foreach Statement
164(1)
yield Statement
164(3)
Different Ways to Iterate Through Collections
165(2)
Using Span with Arrays
167(3)
Creating Slices
167(1)
Changing Values Using Spans
168(1)
ReadOnly Spans
169(1)
Indices and Ranges
170(2)
Indices and the Hat Operator
170(1)
Ranges
170(1)
Efficiently Changing Array Content
171(1)
Indices and Ranges with Custom Collections
172(1)
Array Pools
172(2)
Creating the Array Pool
173(1)
Renting Memory from the Pool
173(1)
Returning Memory to the Pool
174(1)
BitArray
174(2)
Summary
176(1)
Chapter 7 Delegates, Lambdas, And Events
177(16)
Referencing Methods
178(1)
Delegates
178(9)
Declaring Delegates
178(1)
Using Delegates
179(3)
Passing Delegates to Methods
182(1)
Action T and Func T Delegates
183(1)
Multicast Delegates
184(2)
Anonymous Methods
186(1)
Lambda Expressions
187(2)
Parameters
187(1)
Multiple Code Lines
188(1)
Closures
188(1)
Events
189(3)
Event Publisher
190(1)
Event Listener
191(1)
Summary
192(1)
Chapter 8 Collections
193(33)
Overview
194(1)
Collection Interfaces and Types
194(1)
Lists
195(11)
Creating Lists
196(1)
Collection Initializers
197(1)
Adding Elements
197(1)
Inserting Elements
198(1)
Accessing Elements
198(1)
Removing Elements
198(1)
Searching
199(1)
Sorting
200(2)
Read-Only Collections
202(1)
Queues
202(4)
Stacks
206(2)
Linked Lists
208(1)
Sorted List
209(2)
Dictionaries
211(7)
Dictionary Initializers
212(1)
Key Type
212(1)
Dictionary Example
213(4)
Lookups
217(1)
Sorted Dictionaries
217(1)
Sets
218(2)
Performance
220(2)
Immutable Collections
222(3)
Using Builders with Immutable Collections
223(1)
Immutable Collection Types and Interfaces
224(1)
Using LINQ with Immutable Arrays
225(1)
Summary
225(1)
Chapter 9 Language Integrated Query
226(37)
LINQ Overview
227(6)
Lists and Entities
227(2)
LINQ Query
229(1)
Extension Methods
230(1)
Deferred Query Execution
231(2)
Standard Query Operators
233(23)
Filter
234(1)
Filter with Index
235(1)
Type Filtering
236(1)
Compound from
236(1)
Sorting
237(2)
Grouping
239(1)
Variables Within the LINQ Query
240(1)
Grouping with Nested Objects
241(1)
Inner Join
242(3)
Left Outer Join
245(1)
Group Join
246(3)
Set Operations
249(1)
Zip
250(1)
Partitioning
251(1)
Aggregate Operators
252(2)
Conversion Operators
254(1)
Generation Operators
255(1)
Parallel LINQ
256(2)
Parallel Queries
256(1)
Cancellation
257(1)
Expression Trees
258(3)
LINQ Providers
261(1)
Summary
262(1)
Chapter 10 Errors And Exceptions
263(25)
Handling Errors
264(1)
Predefined Exception Classes
264(1)
Catching Exceptions
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)
Exception Filters
273(1)
Rethrowing Exceptions
273(5)
Naively Rethrowing the Exception
275(1)
Changing the Exception
275(1)
Rethrowing the Exception
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)
Caller Information
285(2)
Summary
287(1)
Chapter 11 Tasks And Asynchronous Programming
288(19)
Why Asynchronous Programming Is Important
289(1)
Task-Based Async Pattern
290(1)
Tasks
291(6)
Creating Tasks
292(1)
Calling an Asynchronous Method
292(1)
Using the Awaiter
293(1)
Continuation with Tasks
294(1)
Synchronization Context
294(1)
Using Multiple Asynchronous Methods
295(1)
Calling Asynchronous Methods Sequentially
295(1)
Using Combinators
295(1)
Using ValueTasks
296(1)
Error Handling
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)
Async Streams
300(2)
Async with Windows Apps
302(4)
Configure Await
303(1)
Switch to the UI Thread
304(1)
Using lAsyncOperation
305(1)
Avoid Blocking Scenarios
305(1)
Summary
306(1)
Chapter 12 Reflection, Metadata, And Source Generators
307(28)
Inspecting Code at Runtime and Dynamic Programming
308(1)
Custom Attributes
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)
The VectorClass Library
313(1)
Using Reflection
314(8)
The System.Type Class
314(2)
Type Properties
315(1)
Methods
316(1)
The TypeView Example
316(2)
The Assembly Class
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)
ExpandoObject
325(2)
Source Generators
327(7)
Hello, World Source Generator
328(2)
Source Generators Using Partial Methods
330(4)
Summary
334(1)
Chapter 13 Managed And Unmanaged Memory
335(42)
Memory
336(1)
Memory Management Under the Hood
336(6)
Value Data Types
336(2)
Reference Data Types
338(2)
Garbage Collection
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)
Unsafe Code
349(16)
Accessing Memory Directly with Pointers
349(1)
Writing Unsafe Code with the unsafe Keyword
350(1)
Pointer Syntax
351(1)
Casting Pointers to Integer Types
352(1)
Casting Between Pointer Types
353(1)
void Pointers
353(1)
Pointer Arithmetic
353(2)
The sizeof Operator
355(1)
Pointers to Structs: The Pointer Member Access Operator
355(1)
Pointers to Class Members
356(1)
Pointer Example: PointerPlayground
357(4)
Function Pointers
361(1)
Using Pointers to Optimize Performance
362(3)
Creating Stack-Based Arrays
362(2)
QuickArray Example
364(1)
Span T
365(3)
Spans Referencing the Managed Heap
365(1)
Spans Referencing the Stack
366(1)
Spans Referencing the Native Heap
366(1)
Span Extension Methods
367(1)
Platform Invoke
368(5)
Calling Native Windows APIs
368(3)
Calling Native Linux APIs
371(2)
Using the Library for Calling Native APIs
373(1)
Summary
373(4)
Part II: Libraries
Chapter 14 Libraries, Assemblies, Packages, And Nuget
377(15)
The Hell of Libraries
378(1)
Assemblies
379(2)
Creating and Using Libraries
381(5)
.NET Standard
381(1)
Creating a .NET Library
382(1)
Solution Files
383(1)
Referencing Projects
383(1)
Referencing NuGet Packages
384(1)
NuGet Sources
384(2)
Creating NuGet Packages
386(4)
NuGet Packages with the Command Line
386(1)
Supporting Multiple Platforms
387(2)
NuGet Packages with Visual Studio
389(1)
Module Initializers
390(1)
Summary
391(1)
Chapter 15 Dependency Injection And Configuration
392(27)
What Is Dependency Injection?
393(1)
Using the .NET DI Container
393(2)
Using the Host Class
395(1)
Lifetime of Services
396(7)
Singleton and Transient Services
398(2)
Using Scoped Services
400(3)
Using Custom Factories
403(1)
Initialization of Services Using Options
403(2)
Using Configuration Files
405(1)
Configuration with .NET Applications
406(5)
Using IConfiguration
407(1)
Reading Strongly Typed Values
408(1)
Configuration Sources
408(1)
Production and Development Settings
409(1)
User Secrets
410(1)
Azure App Configuration
411(7)
Creating Azure App Configuration
411(1)
Using Azure App Configuration in the Development Environment
412(2)
Dynamic Configuration
414(1)
Production and Staging Settings with Azure App Configuration
415(1)
Feature Flags
415(2)
Using the Azure Key Vault
417(1)
Summary
418(1)
Chapter 16 Diagnostics And Metrics
419(21)
Diagnostics Overview
420(1)
Logging
421(8)
Configuring Providers
424(2)
Filtering
426(1)
Configure Logging
426(1)
Logging and Tracing with OpenTelemetry
427(2)
More Logging Providers
429(1)
Metrics
429(5)
EventSource Class
429(1)
Metric Counters
430(2)
Using MetricsSampleSource
432(1)
Monitoring Metrics with .NET CLI
433(1)
Analytics with Visual Studio App Center
434(3)
Application Insights
437(2)
Summary
439(1)
Chapter 17 Parallel Programming
440(45)
Overview
441(1)
Parallel Class
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)
Tasks
448(7)
Starting Tasks
448(2)
Tasks Using the Thread Pool
449(1)
Synchronous Tasks
450(1)
Tasks Using a Separate Thread
450(1)
Results from Tasks
450(1)
Continuation Tasks
451(1)
Task Hierarchies
452(1)
Returning Tasks from Methods
453(1)
Waiting for Tasks
453(1)
Value Tasks
453(2)
Cancellation Framework
455(3)
Cancellation of Parallel.For
455(2)
Cancellation of Tasks
457(1)
Channels
458(3)
Creating Bounded and Unbounded Channels
458(1)
Writing to the Channel
459(1)
Reading from the Channel
460(1)
Async Streaming with the Channel
460(1)
Timers
461(2)
Using the Timer Class
461(1)
WinUl Dispatcher Timer
461(2)
Threading Issues
463(5)
Race Conditions
464(2)
Deadlocks
466(2)
Interlocked
468(1)
Monitor
468(1)
SpinLock
469(1)
WaitHandle
470(1)
Mutex
470(1)
Semaphore
471(2)
Events
473(3)
Barrier
476(3)
ReaderWriterLockSlim
479(2)
Locks with await
481(3)
Summary
484(1)
Chapter 18 Files And Streams
485(35)
Overview
486(1)
Managing the File System
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)
Iterating Files
492(1)
Working with Streams
493(10)
Working with File Streams
495(3)
Creating a FileStream
496(1)
Getting Stream Information
496(1)
Analyzing Text File Encodings
497(1)
Reading Streams
498(1)
Writing Streams
499(1)
Copying Streams
499(1)
Using Random Access to Streams
500(2)
Using Buffered Streams
502(1)
Using Readers and Writers
503(2)
The StreamReader Class
503(1)
The StreamWriter Class
504(1)
Reading and Writing Binary Files
505(1)
Compressing Files
505(3)
Using the Deflate Stream
506(1)
Using Brotli
507(1)
Zipping Files
507(1)
Watching File Changes
508(1)
JSON Serialization
509(6)
JSON Serialization
510(2)
JSON Deserialization
512(1)
Using JsonDocument
513(1)
JSON Reader
513(1)
JSON Writer
514(1)
Using Files and Streams with the Windows Runtime
515(4)
Windows App Editor
515(3)
Mapping Windows Runtime Types to .NET Types
518(1)
Summary
519(1)
Chapter 19 Networking
520(38)
Overview
521(1)
Working with Utility Classes
521(5)
URIs
522(1)
IPAddress
523(1)
IPHostEntry
524(1)
DNS
524(2)
Configuring Sockets
526(1)
Using Sockets
526(7)
TCP Echo Sample Using Sockets
526(2)
Creating a Listener
528(2)
Communication with Pipelines
530(2)
Implementing a Receiver
532(1)
Using TCP Classes
533(4)
Creating a TCP Listener
533(2)
Creating a TCP Client
535(2)
Using UDP
537(5)
Building a UDP Receiver
537(2)
Creating a UDP Sender
539(2)
Using Multicasts
541(1)
Using Web Servers
542(6)
Configuring Kestrel
543(1)
Startup
544(1)
HTTP Headers
545(3)
The HttpClient Class
548(6)
Making an Asynchronous Get Request
549(1)
Throwing Exceptions from Errors
550(1)
Creating an HttpRequestMessage
551(1)
Passing Headers
551(2)
Accessing the Content
553(1)
Customizing Requests with HttpMessageHandler
553(1)
HttpClient Factory
554(3)
Typed Clients
555(1)
Named Clients
555(1)
Resilient HTTP Requests
556(1)
Summary
557(1)
Chapter 20 Security
558(24)
Elements of Security
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)
Encrypting Data
566(10)
Getting an X.509 Certificate
569(2)
Creating and Verifying a Signature
571(2)
Implementing Secure Data Exchange
573(3)
Ensuring Web Security
576(5)
Encoding
576(2)
Preventing SQL Injection
578(1)
Protecting Against Cross-Site Request Forgery
579(2)
Summary
581(1)
Chapter 21 Entity Framework Core
582(62)
Introducing EF Core
583(10)
Database Providers
583(1)
Creating an Azure SQL Database
583(1)
Creating a Model
584(1)
Creating a Context
585(1)
Conventions, Annotations, and Fluent API
586(1)
Configuring the Context with the DI Provider
587(1)
Creating the Database
588(1)
Deleting the Database
588(1)
Writing to the Database
589(1)
Reading from the Database
589(1)
Updating with Classes
590(1)
Updating with Records
591(1)
Deleting Records
591(1)
Logging and Metrics
592(1)
Creating a Model
593(7)
Creating a Relation
593(1)
Using the Fluent API for Mapping Definitions
594(1)
Using Self-Contained Type Configuration
595(2)
Mapping to Fields
597(1)
Working with Shadow Properties
598(2)
Scaffolding a Model from the Database
600(1)
Migrations
601(5)
Implementing IDesignTimeDbContextFactory
601(1)
Creating Migrations
602(3)
Applying Migrations Programmatically
605(1)
Other Ways to Apply Migrations
606(1)
Working with Queries
606(6)
Basic Queries
606(3)
Asynchronous Streams
609(1)
Raw SQL Queries
609(1)
Compiled Queries
609(2)
Global Query Filters
611(1)
EF.Functions
612(1)
Loading Related Data
612(5)
Eager Loading Related Data
613(1)
Eager Loading with Filtered Include
613(1)
Explicit Loading Related Data
614(1)
Lazy Loading
615(2)
Working with Relationships
617(8)
Many-to-Many Relations
617(2)
Table Splitting
619(2)
Owned Entities
621(2)
Table per Hierarchy
623(2)
Saving Data
625(5)
Adding Objects with Relations
626(1)
Tracking Objects
627(2)
Updating Objects
629(1)
Updating Untracked Objects
629(1)
Conflict Handling
630(5)
The Last One Wins
631(1)
The First One Wins
632(3)
Using Transactions
635(4)
Using Implicit Transactions
635(1)
Creating Explicit Transactions
636(1)
Using Ambient Transactions
637(2)
Using Azure Cosmos DB
639(4)
Summary
643(1)
Chapter 22 Localization
644(24)
Global Markets
645(1)
Namespace System.Globalization
645(11)
Unicode Issues
645(1)
Cultures and Regions
646(3)
Specific, Neutral, and Invariant Cultures
646(1)
Current Culture and Current UI Culture
647(1)
Number Formatting
647(1)
Date Formatting
648(1)
Cultures in Action
649(5)
Sorting
654(2)
Resources
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)
Localization with WinUl
664(3)
Using the MRT ResourceLoader
665(1)
Using the MRT ResourceManager
666(1)
Changing the Language with a ResourceContext
666(1)
Summary
667(1)
Chapter 23 Tests
668(19)
Overview
668(1)
Unit Testing
669(9)
Creating Unit Tests
669(2)
Running Unit Tests
671(1)
Implementing Complex Methods
671(1)
Expecting Exceptions
672(1)
Testing All Code Paths
673(1)
Code Coverage
674(1)
External Dependencies
675(3)
Using a Mocking Library
678(4)
ASP.NET Core Integration Testing
682(2)
Summary
684(3)
Part III: Web Applications And Services
Chapter 24 ASP.NET Core
687(27)
Understanding Web Technologies
687(2)
HTML
688(1)
CSS
688(1)
JavaScript and TypeScript
688(1)
Scripting Libraries
689(1)
WebAssembly
689(1)
Creating an ASP.NET Core Web Project
689(5)
Host Server
691(1)
Startup
692(1)
Sample Application Preparations
693(1)
Adding Client-Side Content
694(2)
Creating Custom Middleware
696(3)
Endpoint Routing
699(1)
Defining Routes
699(1)
Route Constraints
700(1)
Request and Response
700(6)
Request Headers
701(2)
Query Parameters
703(1)
Form Data
704(1)
Cookies
705(1)
Sending JSON
706(1)
Session State
706(2)
Health Checks
708(3)
Deployment
711(2)
Summary
713(1)
Chapter 25 Services
714(38)
Understanding Today's Services
715(1)
REST Services with ASP.NET Core
715(9)
Defining a Model
716(1)
Creating a Service
716(4)
Creating a Controller
720(2)
Testing REST APIs
722(1)
REST Results and Status Codes
723(1)
Creating a .NET Client
724(6)
Sending GET Requests
725(3)
Sending POST Requests
728(1)
Sending PUT Requests
728(1)
Sending DELETE Requests
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)
Creating a gRPC Project
740(1)
Defining the Contract with Protobuf
741(1)
Implementing a gRPC Service
742(2)
Implementing a gRPC Client
744(2)
Streaming with gRPC
746(2)
Using Azure Functions
748(3)
Creating an Azure Functions Project
748(1)
Adding HTTP Trigger Functions
749(2)
More Azure Services
751(1)
Summary
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)
Razor Pages
755(18)
Layouts
756(1)
Passing Data Between Views
757(1)
Render Sections
757(1)
Routing with Parameters
758(2)
Razor Libraries and Areas
760(1)
Injecting Services
761(1)
Returning Results
761(1)
Model Binding
762(1)
Working with HTML Helpers
762(1)
Working with Tag Helpers
763(1)
Validation of User Input
764(1)
Creating Custom Tag Helpers
765(2)
Creating Elements with Tag Helpers
767(3)
View Components
770(3)
ASP.NET Core MVC
773(5)
MVC Bootstrapping
773(1)
MVC Routing
773(1)
Controllers
774(1)
Razor Views
775(2)
Strongly Typed Views
775(1)
Partial Views
776(1)
Identity UI
777(1)
Summary
778(1)
Chapter 27 Blazor
779(22)
Blazor Server and Blazor WebAssembly
780(2)
Blazor Server
780(1)
WebAssembly
780(1)
Blazor WebAssembly
781(1)
Creating a Blazor Server Web Application
782(6)
Blazor Server Startup
782(1)
Blazor Layout
783(1)
Navigation
784(1)
The Counter Component
785(1)
The FetchData Component
786(2)
Blazor WebAssembly
788(4)
Blazor WebAssembly Startup
789(1)
Injecting HttpClient with Blazor WebAssembly
790(1)
Working with Progressive Web Applications
791(1)
Razor Components
792(8)
Understanding the Parameters of Components
792(1)
Injecting Services
793(1)
Working with Event Callback
794(2)
Programmatically Updating the UI
796(1)
Two-Way Binding
796(1)
Cascading Parameters
797(1)
Using Templated Components
798(1)
Using Built-in Components
799(1)
Summary
800(1)
Chapter 28 SIGNALR
801(18)
Overview
801(1)
Creating a Simple Chat Using SignaIR
802(8)
Creating a Hub
802(2)
Creating a Client with HTML and JavaScript
804(2)
Creating SignaIR .NET Clients
806(4)
Grouping Connections
810(4)
Extending the Hub with Groups
810(1)
Extending the Windows Client App with Groups
811(3)
Streaming with SignaIR
814(2)
Summary
816(3)
Part IV: APPS
Chapter 29 Windows APPS
819(57)
Introducing Windows Apps
819(7)
Windows Runtime
821(1)
Hello, Windows
822(1)
Application Manifest
822(1)
Application Startup
822(2)
Main Window
824(2)
Introducing XAML
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)
Dependency Properties
829(1)
Creating a Dependency Property
830(1)
Value Changed Callbacks and Events
831(1)
Routed Events
832(1)
Attached Properties
833(2)
Markup Extensions
835(1)
Custom Markup Extensions
836(1)
Working with Controls
837(15)
FrameworkElement-Derived UI Elements
838(2)
Presenters
840(1)
Control-Derived Controls
840(7)
Using a TextBox
843(1)
Selecting a Date
843(4)
Range Controls
847(2)
Progress Bar
848(1)
Slider
848(1)
Content Controls
849(1)
Buttons
850(1)
Replacing the Content of the Button
850(1)
Linking with the HyperlinkButton
851(1)
Items Controls
851(1)
Flyouts
852(1)
Working with Data Binding
852(9)
Change Notification with INotifyPropertyChanged
853(2)
Creating a List of Books
855(1)
List Binding
856(1)
Binding Events to Methods
856(1)
Using Data Templates and the Data Template Selector
857(1)
Show Lists and Details
858(1)
Binding Simple Objects
859(1)
Value Conversion
860(1)
Implementing Navigation
861(6)
Hub
862(2)
TabView
864(1)
NavigationView
865(2)
Implementing Layout Panels
867(8)
StackPanel
867(1)
Grid
868(1)
VariableSizedWrapGrid
869(1)
RelativePanel
870(2)
Adaptive Triggers
872(2)
Deferred Loading
874(1)
Summary
875(1)
Chapter 30 Patterns With XAML APPS
876(23)
Why MWM?
876(1)
Defining the MWM Pattern
877(2)
Sample Solution
879(1)
Models
879(3)
Services
882(1)
View Models
883(8)
IEditableObject
886(1)
Concrete View Model Implementations
887(1)
Commands
888(1)
Services, View Models, and Dependency Injection
889(2)
Views
891(6)
Opening Dialogs from View Models
893(1)
Navigating Between Pages
894(3)
Messaging Using Events
897(1)
Summary
898(1)
Chapter 31 Styling Windows APPS
899(34)
Styling
900(1)
Shapes
900(2)
Geometry
902(1)
Geometries Using Segments
902(1)
Geometries Using Path Markup
903(1)
Transformation
903(3)
Scaling
904(1)
Translating
904(1)
Rotating
905(1)
Skewing
905(1)
Transforming with Groups and Composite Transforms
905(1)
Transforming Using a Matrix
905(1)
Brushes
906(2)
SolidColorBrush
906(1)
Gradient Brushes
907(1)
ImageBrush
907(1)
AcrylicBrush
908(1)
Styles and Resources
908(5)
Styles
908(2)
Resource Hierarchies
910(1)
Theme Resources
911(2)
Templates
913(5)
Control Templates
913(2)
Styling a ListView
915(2)
Item Container Style
917(1)
Items Panel
917(1)
Animations
918(10)
Timeline
918(2)
Easing Functions
920(5)
Keyframe Animations
925(1)
Transitions
926(2)
Reposition Transition
926(1)
Pane Transition
926(1)
Transitions for Items
927(1)
Visual State Manager
928(3)
Predefined States with Control Templates
929(1)
Defining Custom States
930(1)
Setting Custom States
931(1)
Summary
931(2)
Index 933
Christian Nagel is a Microsoft MVP for Visual Studio and Development Technologies, software architect, and veteran developer who has been building solutions with .NET technologies since 2000. He has authored many acclaimed .NET books, and he also speaks at such international conferences as Ignite (formerly TechEd) and Tech Days. A supporter of .NET user groups, Christian is a Microsoft Certified Trainer and Professional Developer for WinUI and .NET MAUI Apps, ASP.NET Core, and Microsoft Azure.