Sale!

C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals 9th Edition, ISBN-13: 978-1835881224

Original price was: $50.00.Current price is: $14.99.

Description

C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals 9th Edition, ISBN-13: 978-1835881224

[PDF eBook eTextbook] – Available Instantly

  • Publisher: ‎ Packt Publishing
  • Publication date: ‎ November 12, 2024
  • Edition: ‎ 9th ed.
  • Language: ‎ English
  • 828 pages
  • ISBN-10: ‎ 1835881238
  • ISBN-13: ‎ 978-1835881224

An accessible guide for beginner-to-intermediate programmers to the concepts, real-world applications, and latest features of C# 13 and .NET 9, with hands-on exercises using Visual Studio and Visual Studio Code

Key Features

  • Explore the newest additions to C# 13, the .NET 9 class libraries, and Entity Framework Core 9
  • Build professional websites and services with ASP.NET Core 9 and Blazor
  • Enhance your skills with step-by-step code examples and best practices tips

Book Description

This Packt bestseller continues to be the definitive guide to modern cross-platform development. The 9th edition of C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals has been updated to cover the latest features and improvements in .NET 9 and C# 13. You’ll start by mastering object-oriented programming, learning how to write, test, and debug functions, and implementing interfaces. You’ll then dive into .NET APIs for data management, filesystem operations, and serialization.

This latest edition integrates .NET 9 enhancements into its examples: faster exceptions and new LINQ methods. New ASP.NET Core 9 features include optimized static assets, built-in OpenAPI document generation, and the HybridCache.

Practical examples, such as building websites and services with ASP.NET Core, have been refreshed to utilize the latest .NET 9 features. The book also introduces Blazor, with its new unified hosting model for unparalleled code reusability. With these updates, you’ll learn how to build robust applications and services efficiently and effectively.

By the end of this book, you’ll have the knowledge and confidence to create professional and high-performance web applications using the latest technologies in C# 13 and .NET 9.

What you will learn

  • Discover the new features of .NET 9, including more flexible params and new LINQ like CountBy and Index
  • Leverage the new ASP.NET Core 9 features for optimized static assets, OpenAPI document generation, and HybridCache
  • Utilize the native AOT publish capability for faster startup and reduced memory footprint
  • Build rich web user interface experiences using Blazor in ASP.NET Core 9
  • Integrate and update databases in your applications using Entity Framework Core 9 models
  • Query and manipulate data using LINQ
  • Build powerful services using Minimal APIs

Who this book is for

This book is aimed at beginner to intermediate-level C# and .NET developers. While prior exposure to C# or .NET is not a prerequisite, a general understanding of programming concepts will be beneficial.

If you want to learn more technologies for building modern .NET projects like gRPC, SignalR, and .NET MAUI, read Mark’s Apps and Services with .NET 8 book next; and if you aim to become a professional .NET developer quickly or mainly work on team projects, read his other book, Tools and Skills for .NET 8.

Table of Contents:

Preface
Where to find the code solutions
What this book covers
What you need for this book
Downloading the color images of this book
Conventions
Get in touch
Hello, C#! Welcome, .NET!
Introducing this book and its contents
Getting code solutions for this book
.NET terms used in this book
The structure and style of this book
Topics covered by this book
Topics covered by Apps and Services with .NET 8
Topics covered by Tools and Skills for .NET 8
Finding all my books
Setting up your development environment
Choosing the appropriate tool and application type for learning
VS Code for cross-platform development
GitHub Codespaces for development in the cloud
Visual Studio for general development
What I used
Deploying cross-platform
Downloading and installing Visual Studio
Keyboard shortcuts for Visual Studio
Downloading and installing VS Code
Installing other extensions
Understanding VS Code versions
Keyboard shortcuts for VS Code
Understanding .NET
Understanding .NET support
Understanding end of life (EOL)
Understanding .NET support phases
Understanding .NET runtime and .NET SDK versions
Listing and removing versions of .NET
Understanding intermediate language
Comparing .NET technologies
Building console apps using Visual Studio
Writing code using Visual Studio
Compiling and running code using Visual Studio
Understanding the compiler-generated folders and files
Understanding top-level programs
Requirements for top-level programs
Implicitly imported namespaces
Revealing the hidden code by throwing an exception
Revealing the namespace for the Program class
Adding a second project using Visual Studio
Building console apps using VS Code
Writing code using VS Code
Compiling and running code using the dotnet CLI
Adding a second project using VS Code
Summary of steps for VS Code
Summary of other project types used in this book
Making good use of the GitHub repository for this book
Understanding the solution code on GitHub
Raising issues with the book
Giving me feedback
Avoiding common mistakes
Downloading solution code from the GitHub repository
Using Git with VS Code and the command prompt
Cloning the book solution code repository
Looking for help
Microsoft Learn documentation and Ask Learn
Documentation links in this book
Getting help from the dotnet tool
Getting definitions of types and their members
Configuring inline aka inlay hints
Looking for answers on Stack Overflow
Searching for answers using Google
Getting help on Discord and other chat forums
Searching the .NET source code
Source code in documentation
Official .NET blog, standups, and news
Watching Scott Hanselman’s videos
AI tools like ChatGPT and GitHub Copilot
ChatGPT example
GitHub Copilot for programmers
Disabling tools when they get in the way
Practicing and exploring
Exercise 1.1 – Online material
Current versions of .NET
Upgrade to a new .NET version
freeCodeCamp and C# certification
Explore Polyglot Notebooks
Windows development
C# versus other languages
Free computer science course
.NET newsletters
Exercise 1.2 – Practice exercises
Practice C# anywhere with a browser
Alpha versions of .NET
Exercise 1.3 – Test your knowledge
Exercise 1.4 – Explore topics
Summary
Speaking C#
Introducing the C# language
C# language versions and features
Understanding C# standards
Discovering your C# compiler version
How to output the SDK version
Enabling a specific language version compiler
Using preview C# compiler versions
Switching the C# compiler for .NET 9 to a future version
Showing the compiler version
Understanding C# grammar and vocabulary
Understanding C# grammar
Statements
Comments
Blocks
Regions
Examples of statements and blocks
Formatting code using white space
Understanding C# vocabulary
Comparing programming languages to human languages
Changing the color scheme for C# syntax
Help for writing correct code
Importing namespaces
Implicitly and globally importing namespaces
Verbs are methods
Nouns are types, variables, fields, and properties
Revealing the extent of the C# vocabulary
Example of asking ChatGPT to explain code
Working with variables
Naming things and assigning values
Literal values
Storing text
Outputting emojis
Verbatim strings
Raw string literals
Raw interpolated string literals
Summarizing options for storing text
Storing numbers
Storing whole numbers
Improving legibility by using digit separators
Using binary or hexadecimal notation
Exploring whole numbers
Storing real numbers
Writing code to explore number sizes
Comparing double and decimal types
Special real number values
New number types and unsafe code
Storing Booleans
Storing any type of object
Storing dynamic types
Declaring local variables
Specifying the type of a local variable
Inferring the type of a local variable
What does new do?
Using target-typed new to instantiate objects
Getting and setting the default values for types
Exploring more about console apps
Displaying output to the user
Formatting using numbered positional arguments
Rider and its warnings about boxing
Formatting using interpolated strings
Understanding format strings
Custom number formatting
Getting text input from the user
When does ReadLine return null?
Simplifying the usage of the console
Importing a static type for a single file
Importing a static type for all code files in a project
Getting key input from the user
Passing arguments to a console app
Setting options with arguments
Handling platforms that do not support an API
Practicing and exploring
Exercise 2.1 – Online material
Understanding async and await
Explore Spectre
Exercise 2.2 – Practice exercises
Explore number sizes and ranges
Exercise 2.3 – Test your knowledge
Test your knowledge of number types
Exercise 2.4 – Explore topics
Summary
Controlling Flow, Converting Types, and Handling Exceptions
Operating on variables
Understanding binary operators
Understanding unary operators
Understanding ternary operators
Exploring unary operators
Exploring binary arithmetic operators
Assignment operators
Null-coalescing operators
Exploring logical operators
Exploring conditional logical operators
Exploring bitwise and binary shift operators
Miscellaneous operators
Understanding selection statements
Branching with the if statement
Why you should always use braces with if statements
Pattern matching with the if statement
Branching with the switch statement
Adding a new item to a project using Visual Studio
Pattern matching with the switch statement
Simplifying switch statements with switch expressions
Understanding iteration statements
Looping with the while statement
Looping with the do statement
Looping with the for statement
Looping with the foreach statement
Understanding how foreach works internally
Storing multiple values in an array
Working with single-dimensional arrays
Working with multi-dimensional arrays
Working with jagged arrays
List pattern matching with arrays
Trailing commas
Understanding inline arrays
Summarizing arrays
Casting and converting between types
Casting numbers implicitly and explicitly
How negative numbers are represented in binary
Converting with the System.Convert type
Rounding numbers and the default rounding rules
Taking control of rounding rules
Converting from any type to a string
Converting from a binary object to a string
Base64 for URLs
Parsing from strings to numbers or dates and times
Avoiding Parse exceptions by using the TryParse method
Understanding the Try method naming convention
Handling exceptions
Wrapping error-prone code in a try block
Catching all exceptions
Catching specific exceptions
Catching with filters
Checking for overflow
Throwing overflow exceptions with the checked statement
Disabling compiler overflow checks with the unchecked statement
Practicing and exploring
Exercise 3.1 – Online material
Returning result types versus throwing exceptions
C# 101 notebooks
Exercise 3.2 – Practice exercises
Loops and overflow
Practice loops and operators
Practice exception handling
Exercise 3.3 – Test your knowledge
Test your knowledge of operators
Exercise 3.4 – Explore topics
Summary
Writing, Debugging, and Testing Functions
Writing functions
Exploring top-level programs, functions, and namespaces
What is automatically generated for a local function?
Defining a partial Program class with a static function
What is automatically generated for a static function?
Times table example
A brief aside about arguments and parameters
Writing a function that returns a value
Converting numbers from cardinal to ordinal
Calculating factorials with recursion
Documenting functions with XML comments
Using lambdas in function implementations
Debugging during development
Creating code with a deliberate bug
Setting a breakpoint and starting debugging
Using Visual Studio
Using VS Code
Navigating with the debugging toolbar
Debugging windows
Stepping through code
Using the VS Code integrated terminal during debugging
Customizing breakpoints
Hot reloading during development
Hot reloading using Visual Studio
Hot reloading using VS Code and dotnet watch
Unit testing
Understanding types of testing
Creating a class library that needs testing
Writing unit tests
Running unit tests using Visual Studio
Running unit tests using VS Code
Fixing the bug
Specifying multiple parameter values
Throwing and catching exceptions in functions
Understanding usage errors and execution errors
Commonly thrown exceptions in functions
Throwing exceptions using guard clauses
Understanding the call stack
Where to catch exceptions
Rethrowing exceptions
Implementing the tester-doer and try patterns
Practicing and exploring
Exercise 4.1 – online material
Logging during development and runtime
Exercise 4.2 – practice exercises
Writing functions with debugging and unit testing
Exercise 4.3 – test your knowledge
Exercise 4.4 – explore topics
Summary
Building Your Own Types with Object-Oriented Programming
Talking about OOP
Building class libraries
Creating a class library
Understanding file-scoped namespaces
Defining a class in a namespace
Understanding type access modifiers
Understanding members
Importing a namespace to use a type
Instantiating a class
Inheriting from System.Object
Avoiding a namespace conflict with a using alias
Renaming a type with a using alias
Storing data in fields
Defining fields
Types for fields
Member access modifiers
Setting and outputting field values
Setting field values using object initializer syntax
Storing a value using an enum type
Storing multiple values using an enum type
Changing an enum base type for performance
Storing multiple values using collections
Understanding generic collections
Making a field static
Making a field constant
Making a field read-only
Requiring fields to be set during instantiation
Initializing fields with constructors
Defining multiple constructors
Setting required fields with a constructor
Working with methods and tuples
Returning values from methods
Defining and passing parameters to methods
Overloading methods
Passing optional parameters
Naming parameter values when calling methods
Mixing optional and required parameters
Controlling how parameters are passed
Passing a variable number of parameters
Understanding ref returns
Combining multiple returned values using tuples
Naming the fields of a tuple
Aliasing tuples
Deconstructing tuples
Deconstructing other types using tuples
Implementing functionality using local functions
Splitting classes using partial
Partial methods
Controlling access with properties and indexers
Defining read-only properties
Defining settable properties
Partial properties
Limiting flags enum values
Defining indexers
Pattern matching with objects
Pattern-matching flight passengers
Enhancements to pattern matching in modern C#
Working with record types
Init-only properties
Defining record types
Equality of record types
Equality of other types
Positional data members in records
Defining a primary constructor for a class
Practicing and exploring
Exercise 5.1 – online material
Pattern matching
Exercise 5.2 – practice exercises
Practice access modifiers
Exercise 5.3 – test your knowledge
Exercise 5.4 – explore topics
Summary
Implementing Interfaces and Inheriting Classes
Setting up a class library and console application
Static methods and overloading operators
Implementing functionality using methods
Implementing functionality using operators
Making types safely reusable with generics
Working with non-generic types
Working with generic types
Raising and handling events
Calling methods using delegates
Examples of delegate use
Status: It’s complicated
Defining and handling delegates
Defining and handling events
Implementing interfaces
Common interfaces
Comparing objects when sorting
Comparing objects using a separate class
Implicit and explicit interface implementations
Defining interfaces with default implementations
Working with null values
Making a value type nullable
Understanding null-related initialisms
Understanding nullable reference types
Controlling the nullability warning check feature
Disabling null and other compiler warnings
Declaring non-nullable variables and parameters
Checking for null
Checking for null in method parameters
Inheriting from classes
Extending classes to add functionality
Hiding members
Understanding the this and base keywords
Overriding members
Inheriting from abstract classes
Choosing between an interface and an abstract class
Preventing inheritance and overriding
Understanding polymorphism
Casting within inheritance hierarchies
Implicit casting
Explicit casting
Avoiding casting exceptions
Using is to check a type
Using as to cast a type
Inheriting and extending .NET types
Inheriting exceptions
Extending types when you can’t inherit
Using static methods to reuse functionality
Using extension methods to reuse functionality
Method chaining or fluent style
Summarizing custom type choices
Categories of custom types and their capabilities
Mutability and records
Comparing inheritance and implementation
Reviewing illustrative code
Practicing and exploring
Exercise 6.1 – Online material
Managing memory with reference and value types
Writing better code
Exercise 6.2 – Practice creating an inheritance hierarchy
Exercise 6.3 – Test your knowledge
Exercise 6.4 – Explore topics
Summary
Packaging and Distributing .NET Types
The road to .NET 9
.NET Standard-compatible frameworks
Checking your .NET SDKs for updates
Understanding .NET components
Assemblies, NuGet packages, and namespaces
What is a namespace?
Dependent assemblies
Microsoft .NET project SDKs
PropertyGroup element
ItemGroup element
Label and Condition attributes
Namespaces and types in assemblies
NuGet packages
Package sources
Understanding frameworks
Importing a namespace to use a type
Relating C# keywords to .NET types
Mapping C# aliases to .NET types
Understanding native-sized integers
Revealing the location of a type
Sharing code with legacy platforms using .NET Standard
Understanding defaults for class libraries with different SDKs
Creating a .NET Standard class library
Controlling the .NET SDK
Mixing SDKs and framework targets
Publishing your code for deployment
Creating a console app to publish
Understanding dotnet commands
Getting information about .NET and its environment
Managing projects using the dotnet CLI
Publishing a self-contained app
Publishing a single-file app
Reducing the size of apps using app trimming
Controlling where build artifacts are created
Native ahead-of-time compilation
Limitations of native AOT
Reflection and native AOT
Requirements for native AOT
Enabling native AOT for a project
Building a native AOT project
Publishing a native AOT project
Packaging your libraries for NuGet distribution
Referencing a NuGet package
Fixing dependencies
Packaging a library for NuGet
Publishing a package to a public NuGet feed
Publishing a package to a private NuGet feed
Exploring NuGet packages with a tool
Testing your class library package
Working with preview features
Requiring preview features
Enabling preview features
Method interceptors
Practicing and exploring
Exercise 7.1 – Online material
Experimental MSBuild editor
Improving performance in .NET
Decompiling .NET assemblies
Porting from .NET Framework to modern .NET
Exercise 7.2 – Practice exercises
Creating source generators
Explore PowerShell
Exercise 7.3 – Test your knowledge
Exercise 7.4 – Explore topics
Summary
Working with Common .NET Types
Working with numbers
Working with big integers
Multiplying big integers
Working with complex numbers
Working with tensors
Generating random numbers for games and similar apps
Generating random numbers with the Random class
New random methods in .NET 8 and later
Generating GUIDs
Working with text
Getting the length of a string
Getting the characters of a string
Splitting a string
Getting part of a string
Checking a string for content
Comparing string values
Joining, formatting, and other string members
Building strings efficiently
Working with characters
Searching in strings
Pattern matching with regular expressions
Checking for digits entered as text
Regular expression performance improvements
Understanding the syntax of a regular expression
Examples of regular expressions
Splitting a complex comma-separated string
Activating regular expression syntax coloring
Improving regular expression performance with source generators
Storing multiple objects in collections
Common features of all collections
Working with lists
Working with dictionaries
Sets, stacks, and queues
Collection add and remove methods
Sorting collections
Specialized collections
Read-only, immutable, and frozen collections
Initializing collections using collection expressions
Using the spread element
Good practice with collections
Presizing collections
Passing collections to methods
Returning collections from members
Working with spans, indexes, and ranges
Using memory efficiently using spans
Identifying positions with the Index type
Identifying ranges with the Range type
Using indexes, ranges, and spans
Using spans for efficient text handling
Practicing and exploring
Exercise 8.1 – online material
Working with network resources
Collection expressions
Exercise 8.2 – practice exercises
Regular expressions
Extension methods
Exercise 8.3 – test your knowledge
Exercise 8.4 – explore topics
Summary
Working with Files, Streams, and Serialization
Managing a filesystem
Handling cross-platform environments and filesystems
Managing drives
Managing directories
Managing files
Managing paths
Getting file information
Controlling how you work with files
Reading and writing with streams
Understanding abstract and concrete streams
Understanding storage streams
Understanding function streams
Understanding stream helpers
Building a stream pipeline
Writing to text streams
Writing to XML streams
Simplifying disposal by using the using statement
Compressing streams
Reading and writing with random access handles
Encoding and decoding text
Encoding strings as byte arrays
Encoding and decoding text in files
Serializing object graphs
Serializing as XML
Generating compact XML
Deserializing XML files
Serializing with JSON
High-performance JSON processing
Deserializing JSON files
JSON schema exporter
Controlling JSON processing
A warning about binary serialization using BinaryFormatter
Practicing and exploring
Exercise 9.1 – Online material
Working with tar archives
Migrating from Newtonsoft to new JSON
Exercise 9.2 – Practice exercises
Serializing as XML
Exercise 9.3 – Test your knowledge
Exercise 9.4 – Explore topics
Summary
Working with Data Using Entity Framework Core
Understanding modern databases
Understanding legacy Entity Framework
Using the legacy Entity Framework 6.3 or later
Understanding Entity Framework Core
Understanding Database First and Code First
Performance improvements in EF Core
Using a sample relational database
Using SQLite
Using SQL Server or other SQL systems
Setting up SQLite CLI tools for Windows
Setting up SQLite for macOS and Linux
Setting up EF Core in a .NET project
Creating a console app for working with EF Core
Creating the Northwind sample database for SQLite
If you are using Visual Studio
Managing the Northwind sample database with SQLiteStudio
Using the lightweight ADO.NET database providers
Choosing an EF Core database provider
Connecting to a named SQLite database
Defining the Northwind database context class
Defining EF Core models
Using EF Core conventions to define the model
Using EF Core annotation attributes to define the model
Using the EF Core Fluent API to define the model
Understanding data seeding with the Fluent API
Building EF Core models for the Northwind tables
Defining the Category and Product entity classes
Adding tables to the Northwind database context class
Setting up the dotnet-ef tool
Scaffolding models using an existing database
Reviewing the scaffolded code
Customizing the reverse engineering templates
Configuring preconvention models
Querying EF Core models
Filtering included entities
Filtering and sorting products
Getting the generated SQL
Logging EF Core
Filtering logs by provider-specific values
Logging with query tags
Getting a single entity
Pattern matching with Like
Generating a random number in queries
Defining global filters
SQL SELECT queries
Practicing and exploring
Exercise 10.1 – online materials
Loading and tracking patterns with EF Core
Modifying data with EF Core
Working with transactions
Exploring a Code First EF Core model
Exploring app secrets
NoSQL databases
Exercise 10.2 – practice exercises
Exporting data using different serialization formats
Exercise 10.3 – test your knowledge
Exercise 10.4 – explore topics
Summary
Querying and Manipulating Data Using LINQ
Writing LINQ expressions
Comparing imperative and declarative language features
LINQ components
Building LINQ expressions with the Enumerable class
LINQ in practice
Understanding deferred execution
Filtering entities using Where
Targeting a named method
Simplifying code by removing the explicit delegate instantiation
Targeting a lambda expression
Lambda expressions with default parameter values
Sorting and more
Sorting by a single property using OrderBy
Sorting by a subsequent property using ThenBy
Sorting by the item itself
Declaring a query using var or a specified type
Filtering by type
Working with sets and bags
Getting the index as well as items
Using LINQ with EF Core
Creating a console app for exploring LINQ to Entities
Building an EF Core model
Filtering and sorting sequences
Projecting sequences into new types
Joining, grouping, and lookups
Joining sequences
Group-joining sequences
Grouping for lookups
Practicing and exploring
Exercise 11.1 – Online material
Aggregating and paging sequences
Using multiple threads with parallel LINQ
Working with LINQ to XML
Creating your own LINQ extension methods
Design of the new LINQ methods in .NET 9
Exercise 11.2 – Practice querying with LINQ
Exercise 11.3 – Test your knowledge
Exercise 11.4 – Explore topics
Summary
Introducing Modern Web Development Using .NET
Understanding ASP.NET Core
Classic ASP.NET versus modern ASP.NET Core
Building websites using ASP.NET Core
Comparison of file types used in ASP.NET Core
Building websites using a content management system
Building web applications using SPA frameworks
Building web and other services
Building desktop and mobile apps
Mobile app platforms
.NET MAUI
Uno platform
Avalonia
Structuring projects
Structuring projects in a solution
Central package management
Building an entity model for use in the rest of the book
Creating the Northwind database
Creating a class library for entity models using SQLite
Creating a class library for a database context using SQLite
Customizing the model and defining an extension method
HasDefaultValue and HasDefaultValueSql
Registering the scope of a dependency service
Creating class libraries for entity models using SQL Server
Improving the class-to-table mapping
Testing the class libraries
Understanding web development
Understanding the Hypertext Transfer Protocol
Understanding the components of a URL
Using Google Chrome to make HTTP requests
Understanding client-side web development technologies
Practicing and exploring
Exercise 12.1 – Online material
Exercise 12.2 – Practice exercises
Troubleshooting web development
Exercise 12.3 – Test your knowledge
Know your webbreviations
Exercise 12.4 – Explore topics
Summary
Building Websites Using ASP.NET Core
Exploring ASP.NET Core
Architecture of ASP.NET Core
Creating an empty ASP.NET Core project
Testing and securing the website
Enabling stronger security and redirecting to a secure connection
Controlling the hosting environment
Enabling a website to serve static content
Creating a folder for static files and a web page
Enabling static and default files
Understanding MapStaticAssets
Understanding browser requests during development
History of Blazor
JavaScript and friends
Silverlight – C# and .NET using a plugin
WebAssembly – a target for Blazor
Blazor hosting models in .NET 7 and earlier
Unification of Blazor hosting models in .NET 8
Understanding Blazor components
What is the difference between Blazor and Razor?
Exploring Blazor static SSR
Enabling Blazor static SSR
Adding code to a Blazor static SSR page
Using shared layouts with Blazor static SSR pages
Creating a suppliers page
Configuring files included in an ASP.NET Core project
Project file build actions
Using Entity Framework Core with ASP.NET Core
Configuring Entity Framework Core as a service
Practicing and exploring
Exercise 13.1 – online material
Configuring services and the HTTP request pipeline
Enabling HTTP/3 and request decompression support
Introducing Bootstrap
Exercise 13.2 – practice exercises
Build a data-driven web page
Build web pages for functions
Exercise 13.3 – test your knowledge
Exercise 13.4 – explore topics
Summary
Building Interactive Web Components Using Blazor
Reviewing the Blazor Web App project template
Creating a Blazor Web App project
Reviewing Blazor routing, layouts, and navigation
How to define a routable page component
How to navigate routes and pass route parameters
How to use the navigation link component with routes
Understanding base component classes
Running the Blazor Web App project template
Building components using Blazor
Defining and testing a simple Blazor component
Using Bootstrap icons
Making the component a routable page component
Getting entities into a Blazor component
Abstracting a service for a Blazor component
Enabling streaming rendering
Defining forms using the EditForm component
Building a customer detail component
Building customer create, edit, and delete components
Testing the customer components
Practicing and exploring
Exercise 14.1 – Online material
Enhancing Blazor apps
Leveraging open source Blazor component libraries
Exercise 14.2 – Practice exercises
Creating a times table component
Creating a country navigation item
Exercise 14.3 – Test your knowledge
Exercise 14.4 – Explore topics
Summary
Building and Consuming Web Services
Building web services using ASP.NET Core
Understanding web service acronyms
Understanding HTTP requests and responses
ASP.NET Core Minimal APIs projects
Minimal APIs web service and native AOT compilation
Creating an ASP.NET Core Minimal API project
Reviewing the web service’s functionality
Route constraints
Short-circuit routes
Improved route tooling in ASP.NET Core 8 and later
Understanding endpoint route handler return types
Creating a web service for the Northwind database
Registering dependency services
In-memory, distributed, and hybrid caches
In-memory caching
Distributed caching
Hybrid caching
Creating data repositories with caching for entities
Configuring the customer repository
Specifying problem details
Documenting and trying out web services
Trying out GET requests using a browser
Making GET requests using HTTP/REST tools
Making other requests using HTTP/REST tools
Passing environment variables
Understanding the OpenAPI Specification
Enabling HTTP logging
Logging to the Windows-only Event Log
Support for logging additional request headers in W3CLogger
Consuming web services using HTTP clients
Understanding HttpClient
Configuring HTTP clients
Getting customers as JSON in a Blazor component
Starting multiple projects
If you are using Visual Studio
If you are using VS Code
Starting the web service and Blazor client projects
Practicing and exploring
Exercise 15.1 – Online material
Implementing advanced features for web services
Minimal APIs parameter binding
Refit client
Web service security using Microsoft Identity
Exercise 15.2 – Practice exercises
Creating and deleting customers with HttpClient
Exercise 15.3 – Test your knowledge
Exercise 15.4 – Explore topics
Summary
Epilogue
Next steps on your C# and .NET learning journey
Polishing your skills with design guidelines
Companion books to continue your learning journey
Other books to take your learning further
The tenth edition for .NET 10
Good luck!
Leave a Review!
Index

Mark J. Price is a Microsoft Specialist: Programming in C# and Architecting Microsoft Azure Solutions, with over 20 years’ experience. Since 1993, he has passed more than 80 Microsoft programming exams and specializes in preparing others to pass them. Between 2001 and 2003, Mark was employed to write official courseware for Microsoft in Redmond, USA. His team wrote the first training courses for C# while it was still an early alpha version. While with Microsoft, he taught “train-the-trainer” classes to get other MCTs up-to-speed on C# and .NET. Mark holds a Computer Science BSc. Hons. Degree.

What makes us different?

• Instant Download

• Always Competitive Pricing

• 100% Privacy

• FREE Sample Available

• 24-7 LIVE Customer Support