Details

Professional C# and .NET


Professional C# and .NET


2021 Edition

von: Christian Nagel

39,99 €

Verlag: Wiley
Format: PDF
Veröffentl.: 25.08.2021
ISBN/EAN: 9781119797227
Sprache: englisch
Anzahl Seiten: 1008

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<p><b>Get the latest coverage of the newest features in C#9 and .NET 5</b></p> <p>In <i>Professional C# and .NET: 2021 Edition</i>, 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.</p> <p>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.</p> <p>The book also offers:</p> <ul> <li>Discussions of the extension of .NET to non-Microsoft platforms like OSX and Linux</li> <li>Explanations of the newest features in C#9, including support for record types, and enhanced support for tuples, pattern matching, and nullable reference types</li> <li>Integrating .NET applications with Microsoft Azure services such as Azure App</li> <li>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</li> </ul> <p>Perfect for programmers with a background in C#, Visual Basic, Java, or C/C++, <i>Professional C# and .NET: 2021 Edition</i> 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.</p>
<p>Introduction xxxix</p> <p><b>Part I: The C# Language</b></p> <p><b>Chapter 1: .NET Applications and Tools 3</b></p> <p>From .NET Framework to .NET Core to .NET 3</p> <p>.NET Terms 4</p> <p>.NET Support Length 9</p> <p>Application Types and Technologies 10</p> <p>Microsoft Azure 12</p> <p>Developer Tools 14</p> <p>Using the .NET CLI 16</p> <p>Summary 23</p> <p><b>Chapter 2: Core C# 24</b></p> <p>Fundamentals of C# 25</p> <p>Nullable Types 30</p> <p>Using Predefined Types 33</p> <p>Controlling Program Flow 37</p> <p>Organization with Namespaces 44</p> <p>Working with Strings 45</p> <p>Comments 49</p> <p>C# Preprocessor Directives 51</p> <p>C# Programming Guidelines 54</p> <p>Summary 58</p> <p><b>Chapter 3: Classes, Records, Structs, and Tuples 59</b></p> <p>Creating and Using Types 60</p> <p>Pass by Value or by Reference 60</p> <p>Classes 62</p> <p>Records 77</p> <p>Structs 79</p> <p>Enum Types 80</p> <p>ref, in, and out 83</p> <p>Tuples 86</p> <p>ValueTuple 88</p> <p>Deconstruction 88</p> <p>Pattern Matching 89</p> <p>Partial Types 92</p> <p>Summary 94</p> <p><b>Chapter 4: Object-Oriented Programming in C# 95</b></p> <p>Object Orientation 96</p> <p>Inheritance with Classes 96</p> <p>Modifiers 104</p> <p>Inheritance with Records 106</p> <p>Using Interfaces 107</p> <p>Generics 115</p> <p>Summary 118</p> <p><b>Chapter 5: Operators and Casts 119</b></p> <p>Operators 120</p> <p>Using Binary Operators 127</p> <p>Type Safety 132</p> <p>Operator Overloading 136</p> <p>Comparing Objects for Equality 139</p> <p>Implementing Custom Indexers 142</p> <p>User-Defined Conversions 143</p> <p>Summary 152</p> <p><b>Chapter 6: Arrays 153</b></p> <p>Multiple Objects of the Same Type 154</p> <p>Simple Arrays 154</p> <p>Multidimensional Arrays 157</p> <p>Jagged Arrays 158</p> <p>Array Class 159</p> <p>Arrays as Parameters 163</p> <p>Enumerators 163</p> <p>Using Span with Arrays 167</p> <p>Indices and Ranges 170</p> <p>Array Pools 172</p> <p>BitArray 174</p> <p>Summary 176</p> <p><b>Chapter 7: Delegates, Lambdas, and Events 177</b></p> <p>Referencing Methods 178</p> <p>Delegates 178</p> <p>Lambda Expressions 187</p> <p>Events 189</p> <p>Summary 192</p> <p><b>Chapter 8: Collections 193</b></p> <p>Overview 194</p> <p>Collection Interfaces and Types 194</p> <p>Lists 195</p> <p>Stacks 206</p> <p>Linked Lists 208</p> <p>Sorted List 209</p> <p>Dictionaries 211</p> <p>Sets 218</p> <p>Performance 220</p> <p>Immutable Collections 222</p> <p>Summary 225</p> <p><b>Chapter 9: Language Integrated Query 226</b></p> <p>LINQ Overview 227</p> <p>Standard Query Operators 233</p> <p>Parallel LINQ 256</p> <p>Expression Trees 258</p> <p>LINQ Providers 261</p> <p>Summary 262</p> <p><b>Chapter 10: Errors and Exceptions 263</b></p> <p>Handling Errors 264</p> <p>Predefined Exception Classes 264</p> <p>Catching Exceptions 265</p> <p>User-Defined Exception Classes 278</p> <p>Caller Information 285</p> <p>Summary 287</p> <p><b>Chapter 11: Tasks and Asynchronous Programming 288</b></p> <p>Why Asynchronous Programming Is Important 289</p> <p>Task-Based Async Pattern 290</p> <p>Tasks 291</p> <p>Error Handling 297</p> <p>Cancellation of async Methods 299</p> <p>Async Streams 300</p> <p>Async with Windows Apps 302</p> <p>Summary 306</p> <p><b>Chapter 12: Reflection, Metadata, And Source Generators 307</b></p> <p>Inspecting Code at Runtime and Dynamic Programming 308</p> <p>Custom Attributes 308</p> <p>Using Reflection 314</p> <p>Using Dynamic Language Extensions for Reflection 322</p> <p>ExpandoObject 325</p> <p>Source Generators 327</p> <p>Summary 334</p> <p><b>Chapter 13: Managed and Unmanaged Memory 335</b></p> <p>Memory 336</p> <p>Memory Management Under the Hood 336</p> <p>Strong and Weak References 342</p> <p>Working with Unmanaged Resources 344</p> <p>Unsafe Code 349</p> <p>Span<T> 365</p> <p>Platform Invoke 368</p> <p>Summary 373</p> <p><b>Part II: Libraries</b></p> <p><b>Chapter 14: Libraries, Assemblies, Packages, and Nuget 377</b></p> <p>The Hell of Libraries 378</p> <p>Assemblies 379</p> <p>Creating and Using Libraries 381</p> <p>Creating NuGet Packages 386</p> <p>Module Initializers 390</p> <p>Summary 391</p> <p><b>Chapter 15: Dependency Injection and Configuration 392</b></p> <p>What Is Dependency Injection? 393</p> <p>Using the .NET DI Container 393</p> <p>Using the Host Class 395</p> <p>Lifetime of Services 396</p> <p>Initialization of Services Using Options 403</p> <p>Using Configuration Files 405</p> <p>Configuration with .NET Applications 406</p> <p>Azure App Configuration 411</p> <p>Summary 418</p> <p><b>Chapter 16: Diagnostics and Metrics 419</b></p> <p>Diagnostics Overview 420</p> <p>Logging 421</p> <p>Metrics 429</p> <p>Analytics with Visual Studio App Center 434</p> <p>Application Insights 437</p> <p>Summary 439</p> <p><b>Chapter 17: Parallel Programming 440</b></p> <p>Overview 441</p> <p>Parallel Class 442</p> <p>Tasks 448</p> <p>Cancellation Framework 455</p> <p>Channels 458</p> <p>Timers 461</p> <p>Threading Issues 463</p> <p>Interlocked 468</p> <p>Monitor 468</p> <p>SpinLock 469</p> <p>WaitHandle 470</p> <p>Mutex 470</p> <p>Semaphore 471</p> <p>Events 473</p> <p>Barrier 476</p> <p>ReaderWriterLockSlim 479</p> <p>Locks with await 481</p> <p>Summary 484</p> <p><b>Chapter 18: Files and Streams 485</b></p> <p>Overview 486</p> <p>Managing the File System 486</p> <p>Iterating Files 492</p> <p>Working with Streams 493</p> <p>Using Readers and Writers 503</p> <p>Compressing Files 505</p> <p>Watching File Changes 508</p> <p>JSON Serialization 509</p> <p>Using Files and Streams with the Windows Runtime 515</p> <p>Summary 519</p> <p><b>Chapter 19: Networking 520</b></p> <p>Overview 521</p> <p>Working with Utility Classes 521</p> <p>Using Sockets 526</p> <p>Using TCP Classes 533</p> <p>Using UDP 537</p> <p>Using Web Servers 542</p> <p>The HttpClient Class 548</p> <p>HttpClient Factory 554</p> <p>Summary 557</p> <p><b>Chapter 20: Security 558</b></p> <p>Elements of Security 559</p> <p>Verifying User Information 559</p> <p>Encrypting Data 566</p> <p>Ensuring Web Security 576</p> <p>Summary 581</p> <p><b>Chapter 21: Entity Framework Core 582</b></p> <p>Introducing EF Core 583</p> <p>Creating a Model 593</p> <p>Scaffolding a Model from the Database 600</p> <p>Migrations 601</p> <p>Working with Queries 606</p> <p>Loading Related Data 612</p> <p>Working with Relationships 617</p> <p>Saving Data 625</p> <p>Conflict Handling 630</p> <p>Using Transactions 635</p> <p>Using Azure Cosmos DB 639</p> <p>Summary 643</p> <p><b>Chapter 22: Localization 644</b></p> <p>Global Markets 645</p> <p>Namespace System.Globalization 645</p> <p>Resources 656</p> <p>Localization with ASP.NET Core 658</p> <p>Localization with WinUI 664</p> <p>Summary 667</p> <p><b>Chapter 23: Tests 668</b></p> <p>Overview 668</p> <p>Unit Testing 669</p> <p>Using a Mocking Library 678</p> <p>ASP.NET Core Integration Testing 682</p> <p>Summary 684</p> <p><b>Part III: Web Applications and Services</b></p> <p><b>Chapter 24: Asp.NET Core 687</b></p> <p>Understanding Web Technologies 687</p> <p>Creating an ASP.NET Core Web Project 689</p> <p>Adding Client-Side Content 694</p> <p>Creating Custom Middleware 696</p> <p>Endpoint Routing 699</p> <p>Request and Response 700</p> <p>Session State 706</p> <p>Health Checks 708</p> <p>Deployment 711</p> <p>Summary 713</p> <p><b>Chapter 25: Services 714</b></p> <p>Understanding Today’s Services 715</p> <p>REST Services with ASP.NET Core 715</p> <p>Creating a .NET Client 724</p> <p>Using EF Core with Services 730</p> <p>Authentication and Authorization with Azure AD B2C 732</p> <p>Implementing and Using Services with GRPC 740</p> <p>Using Azure Functions 748</p> <p>More Azure Services 751</p> <p>Summary 751</p> <p><b>Chapter 26: Razor Pages and MVC 752</b></p> <p>Setting Up Services for Razor Pages and MVC 753</p> <p>Razor Pages 755</p> <p>ASP.NET Core MVC 773</p> <p>Summary 778</p> <p><b>Chapter 27: Blazor 779</b></p> <p>Blazor Server and Blazor WebAssembly 780</p> <p>Creating a Blazor Server Web Application 782</p> <p>Blazor WebAssembly 788</p> <p>Razor Components 792</p> <p>Summary 800</p> <p><b>Chapter 28: Signalr 801</b></p> <p>Overview 801</p> <p>Creating a Simple Chat Using SignalR 802</p> <p>Grouping Connections 810</p> <p>Streaming with SignalR 814</p> <p>Summary 816</p> <p><b>Part IV: Apps</b></p> <p><b>Chapter 29: Windows Apps 819</b></p> <p>Introducing Windows Apps 819</p> <p>Introducing XAML 826</p> <p>Working with Controls 837</p> <p>Working with Data Binding 852</p> <p>Implementing Navigation 861</p> <p>Implementing Layout Panels 867</p> <p>Summary 875</p> <p><b>Chapter 30: Patterns with XAML Apps 876</b></p> <p>Why MVVM? 876</p> <p>Defining the MVVM Pattern 877</p> <p>Sample Solution 879</p> <p>Models 879</p> <p>Services 882</p> <p>View Models 883</p> <p>Views 891</p> <p>Messaging Using Events 897</p> <p>Summary 898</p> <p><b>Chapter 31: Styling Windows Apps 899</b></p> <p>Styling 900</p> <p>Shapes 900</p> <p>Geometry 902</p> <p>Transformation 903</p> <p>Brushes 906</p> <p>Styles and Resources 908</p> <p>Templates 913</p> <p>Animations 918</p> <p>Visual State Manager 928</p> <p>Summary 931</p> <p>Index 933</p>
<p><b>Christian Nagel</b> 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.</p>
<p><b>Your insider's guide to C#—with advanced tips for new features</b></p> <p>This expert-level guide is the fastest way for experienced programmers to get up to speed. C# is about getting more done faster, and no one else is better qualified to deliver authoritative details that are valuable in the real world than Microsoft MVP Christian Nagel. With a hands-on clarity that leads to a competitive edge, he shows developers how to build .NET solutions for Windows and Linux platforms and extend development to use Microsoft Azure services, and interact in the space in many other significant ways.</p> <p><i>Professional C# and .NET:</i></p> <ul> <li>Opens up the extensive new features of C# and .NET for advanced developers who need state-of-the-art libraries and tools</li> <li>Reveals the latest hacks and practical tips for using .NET libraries including channels, async streams, the new JSON serializer, and more</li> <li>Explains innovative ways for developing microservices using ASP.NET Core, GRPC, SignalR, Azure Functions, and Docker</li> <li>Features step-by-step guidance for developing web applications including ASP.NET Core Razor as well as ASP.NET Core Blazor with WebAssembly</li> <li>Jump starts mastery of developing Windows desktop applications using the new WinUI 3 library</li> </ul> <p><b>Wrox Professional guides</b> are written by working programmers to meet the real-world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.</p>

Diese Produkte könnten Sie auch interessieren:

Domain Architectures
Domain Architectures
von: Daniel J. Duffy
PDF ebook
31,99 €