The brand new version of my e-book is out there – masking .NET, C#, WinUI, ASP.NET Core, EF Core, and extra! In comparison with the earlier version, it not solely covers the most recent editions of C# and .NET, you don’t have to hold a e-book with 1500 pages – the variety of pages have been diminished – however I made positive that every one the necessary matters are coated, you shouldn’t miss something necessary matters wanted to develop functions with .NET, C#, and Microsoft Azure.
This e-book is nice for builders shifting from different programming languages to C# and .NET, but in addition for builders already working with .NET to learn info on new options.
Let’s get into the small print on what’s on this e-book!
Half I – The Language
The primary a part of the e-book covers all of the facets of the C# programming language – together with new options equivalent to prime degree statements, information, sample matching, supply mills, and extra. All of the code samples use nullable reference varieties.
Chapter 1: .NET Purposes and Instruments
This chapter covers utilizing the instruments to create .NET functions together with the .NET CLI.
Chapter 2: Core C#
Chapter 2 dives into core C# options and provides you particulars on top-level statements and knowledge on declaration of variables and knowledge varieties. This chapter covers target-typed new expressions, explains nullable reference varieties, and defines a program movement that features the brand new swap expression.
Chapter 3: Courses, Information, Structs, and Tuples
Chapter 3 provides you info on the variations between reference and worth varieties, and covers options of C# 9 information. Right here info is roofed about members of a kind together with strategies, properties, fields, and extra.
Chapter 4: Object-Oriented Programming in C#
This chapter goes into particulars on object-oriented strategies with C# and covers inheritance with courses, utilizing interfaces, and the way you should utilize inheritance with information. It helps to already know object-orientation earlier than studying this chapter. This chapter covers dependency injection with interfaces.
Chapter 5: Operators and Casts
Chapter 5 explaines the C# operations, and also you additionally discover ways to overload customary operations for customized varieties.
Chapter 6: Arrays
The chapter Arrays doesn’t cease with easy arrays; you be taught utilizing multidimensional arrays and jagged arrays, use the
Span sort to entry arrays, and use the brand new index and vary operators.
Chapter 7: Delegates, Lambdas, and Occasions
Chapter 7 covers .NET tips that could strategies, lambda expresions with closures, and .NET occasions.
Chapter 8: Collections
The Collections chapter dives into totally different type of collections, equivalent to lists, queues, stacks, dictionaries, and immutable collections. This chapter additionally provides you the data it’s essential to resolve which assortment to make use of wherein state of affairs.
Chapter 9: Language Built-in Question
Langugae Built-in Question (LINQ) provides you the C# built-in question options to question knowledge out of your collections – utilizing the question and the strategy syntax. You additionally discover ways to use a number of CPU cores with a question and what’s behind expression bushes which might be used while you use LINQ to entry your database with Entity Framework Core.
Chapter 10: Errors and Exceptions
Errors and Exceptions covers how it is best to take care of errors, throw and catch exceptions, and filter exceptions when catching them.
Chapter 11: Duties and Asynchronous Programming
Duties and Asynchronous Programming exhibits the C# key phrases
await in motion— not solely with the task-based async sample but in addition with async streams.
Chapter 12: Reflection, Metadata, and Supply Turbines
Reflection, Metadata, and Supply Turbines covers utilizing and studying attributes with C#. The attributes won’t simply be learn utilizing reflection, however you’ll additionally see the performance of supply mills that permit creating supply code throughout compile time.
Chapter 13: Managed and Unmanaged Reminiscence
Managed and Unmanaged Reminiscence is the final chapter of Half I, which not solely exhibits
IDisposable interface with the
utilizing assertion and the brand new
utilizing declaration but in addition
demonstrates utilizing the
Span sort with managed and unmanaged reminiscence. You possibly can examine utilizing
Platform Invoke each with Home windows and with Linux environments
Half II – Libraries
Half II begins with creating customized libraries and NuGet packages, however the main matters coated with Half II are for utilizing .NET core libraries which might be necessary for all utility varieties.
Chapter 14: Libraries, Assemblies, Packages, and NuGet
Libraries, Assemblies, Packages, and NuGet explains the variations between assemblies and NuGet packages. On this chapter, you discover ways to create NuGet packages and are launched to a brand new C# characteristic, module initializers, which let you run preliminary code in a library
Chapter 15: Dependency Injection and Configuration
Dependency Injection and Configuration provides element about how the
Host class is used to configure a dependency injection container and the built-in choices to retrieve configuration info from a .NET utility with totally different configuration suppliers, together with Azure App Configuration and consumer secrets and techniques.
Chapter 16: Diagnostics and Metrics
Diagnostics and Metrics continues utilizing the Host class to configure logging choices. You additionally find out about studying metric info that’s supplied from some NET suppliers, utilizing Visible Studio App Heart, and lengthening logging for distributed tracing with OpenTelemetry.
Chapter 17: Parallel Programming
Parallel Programming covers myriad options obtainable with .NET for parallelization and synchronization. Chapter 11 exhibits the core performance of the
Process class. In Chapter 17, extra of the
Process class is proven, equivalent to forming job hierarchies and utilizing worth duties. The chapter goes into problems with parallel programming equivalent to race circumstances and deadlocks, and for synchronization, you be taught
about totally different options obtainable with the
lock key phrase, the
Semaphore courses, and extra.
Chapter 18: Recordsdata and Streams
Recordsdata and Streams not solely covers studying and writing from the file system with new stream APIs that permit utilizing the
Span sort but in addition covers the brand new .NET JSON serializer with courses within the
System.Textual content.Json namespace.
Chapter 19: Networking
In chapter Networking you find out about foundational courses for community programming, such because the
Socket class and how one can create functions utilizing TCP and UDP. You additionally use the
manufacturing unit sample to create
HttpClient objects with automated retries if transient errors happen.
Chapter 20: Safety
Safety provides you details about cryptography courses for encrypting knowledge, explains how one can use the brand new
Microsoft.Id platform for consumer authentication, and gives info on internet safety and what you want to pay attention to with encoding points in addition to cross-site request forgery assaults
Chapter 21: Entity Framework Core
Entity Framework Core covers studying and writing knowledge from a database—together with the numerous options supplied from EF Core, equivalent to shadow properties, world question filters, many-to-many relations, and what metric info is now supplied by EF Core—and studying and writing to Azure Cosmos DB with EF Core
Chapter 22: Localization
With Localization you be taught to localize functions utilizing strategies which might be necessary each for Home windows and internet functions.
Chapter 23: Assessments
Assessments covers creating unit exams, analyzing code protection with the .NET CLI, utilizing a mocking library when creating unit exams, and what options are supplied by ASP.NET Core to create integration exams
Half III – Internet Purposes and Providers
Half III of this e-book is devoted to ASP.NET Core applied sciences for creating internet functions and companies, irrespective of whether or not you run these functions and companies in your on-premises surroundings or within the cloud making use of Azure App Providers, Azure Static Internet Apps, or Azure Features.
Chapter 24: ASP.NET Core
This chapter provides you the inspiration of ASP.NET Core. Primarily based on the dependency injection container you discovered about in Half II, this chapter exhibits how ASP.NET Core makes use of middleware so as to add performance to each HTTP request and outline routes with ASP.NET Core endpoint routing.
Chapter 25: Providers
Providers dives into creating microservices utilizing totally different applied sciences equivalent to ASP.NET Core in addition to utilizing Azure Features and gRPC for binary communication.
Chapter 26: Razor Pages and MVC
This chapter is about interacting with customers with ASP.NET Core applied sciences. It covers Razor pages, Razor views, and performance equivalent to tag helpers and consider elements.
Chapter 27: Blazor
Blazor is concerning the latest enhancement of ASP.NET Core with Razor elements, which lets you implement C# code working both on the server or within the shopper utilizing WebAssembly. You be taught concerning the variations between Blazor Server and Blazor WebAssembly, what the restrictions are with these applied sciences, and the built-in elements obtainable.
Chapter 28: SignalR
This chapter covers the real-time performance obtainable with ASP.NET Core to ship info to a gaggle of purchasers and the way you should utilize C# async streams with SignalR.
Half IV: Apps
Half IV of this e-book is devoted to XAML code and creating Home windows functions with the native UI platform for Home windows 10: WinUI. A lot of the data you get right here may also be utilized to WPF functions and to .NET MAUI and creating XAML-based functions for cellular platforms.
Chapter 29: Home windows Apps
Home windows Apps provides you foundational info on XAML, together with dependency properties and connected properties. You discover ways to create customized markup extensions and concerning the management classes obtainable with WinUI, together with superior strategies equivalent to adaptive triggers and deferred loading.
Chapter 30: Patterns with XAML Apps
This chapter provides you the data it’s essential to use the MVVM sample and how one can share as a lot code as attainable between totally different XAML-based applied sciences equivalent to WinUI, WPF, and .NET MAUI.
Chapter 31: Styling Home windows Apps
Styling Home windows Apps explains XAML shapes and geometry components, dives into types and management templates, provides you info on creating animations, and explains how you should utilize the Visible State Supervisor along with your XAML-based functions.
The Supply Code
Points and Discussions
In case you will have some questions on the samples, please write messages to discussions. Wanting ahead to see questions and doubtless additionally solutions from readers. In case you discover issues with supply code samples, report an situation. I’ll attempt to reply/repair it as quick as my time permits. You’re additionally free to submit a pull request with modifications on code samples in case you discover some points (the primary reader who did a pull request was @LuohuaRain – thanks for that!).
> It might be nice in case you Star the GitHub repo. You’re additionally welcome to fork it to your GitHub account to simpler work with the present code samples.
With C# and .NET we’ll have steady updates, new options are added to the C# programming language and to libraries. The code samples can be up to date as nicely. Earlier than C# 10 and .NET 6 is launched, you’ll discover supply code updates in dotnet6 branches. After .NET 6 is launched, the fundamental department will comprise C# 10 and .NET 6 code samples. The code samples as written within the printed e-book will keep to be obtainable within the dotnet5 department.
New code samples can be defined in my weblog. Each e-book chapter has a readme file. This file will comprise info to up to date and new code samples, together with hyperlinks to weblog articles.
Shopping for Skilled C# and .NET – 2021 Version
You should buy the e-book or print version of the e-book straight from Wiley. After all you should purchase the e-book from Amazon for Kindle or a Paperback version and lots of different distributors!
Get pleasure from studying the e-book and checking the code samples, studying C# and .NET!