Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals
  • Table Of Contents Toc
  • Feedback & Rating feedback
C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals

C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals - Ninth Edition

By : Mark J. Price
4.3 (4)
close
close
C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals

C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals

4.3 (4)
By: Mark J. Price

Overview of this book

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.
Table of Contents (18 chapters)
close
close
17
Index

Pattern matching with objects

In Chapter 3, Controlling Flow, Converting Types, and Handling Exceptions, you were introduced to basic pattern matching. In this section, we will explore pattern matching in more detail.

Pattern matching flight passengers

In this example, we will define some classes that represent various types of passengers on a flight, and then we will use a switch expression with pattern matching to determine the cost of their flight:

  1. In the PacktLibraryNet2 project/folder, add a new file named FlightPatterns.cs.
  2. If you use Visual Studio, in FlightPatterns.cs, delete the existing statements, including the class named FlightPatterns, because we will define multiple classes, and none match the name of the code file.
  3. In FlightPatterns.cs, add statements to define three types of passengers with different properties, as shown in the following code:
// All the classes in this file will be defined in the following namespace.
namespace Packt.Shared;
public class Passenger...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon