▶Book Description
In C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development, Fourth Edition, expert teacher Mark J. Price gives you everything you need to start programming C# applications.
This latest edition uses the popular Visual Studio Code editor to work across all major operating systems. It is fully updated and expanded with new chapters on Content Management Systems (CMS) and machine learning with ML.NET.
The book covers all the topics you need. Part 1 teaches the fundamentals of C#, including object-oriented programming, and new C# 8.0 features such as nullable reference types, simplified switch pattern matching, and default interface methods. Part 2 covers the .NET Standard APIs, such as managing and querying data, monitoring and improving performance, working with the filesystem, async streams, serialization, and encryption. Part 3 provides examples of cross-platform applications you can build and deploy, such as web apps using ASP.NET Core or mobile apps using Xamarin.Forms. The book introduces three technologies for building Windows desktop applications including Windows Forms, Windows Presentation Foundation (WPF), and Universal Windows Platform (UWP) apps, as well as web applications, web services, and mobile apps.
▶What You Will Learn
- Build cross-platform applications for Windows, macOS, Linux, iOS, and Android
- Explore application development with C# 8.0 and .NET Core 3.0
- Explore ASP.NET Core 3.0 and create professional web applications
- Learn object-oriented programming and C# multitasking
- Query and manipulate data using LINQ
- Use Entity Framework Core and work with relational databases
- Discover Windows app development using the Universal Windows Platform and XAML
- Build mobile applications for iOS and Android using Xamarin.Forms
▶Key Features
- Build modern, cross-platform applications with .NET Core 3.0
- Get up to speed with C#, and up to date with all the latest features of C# 8.0
- Start creating professional web applications with ASP.NET Core 3.0
▶Who This Book Is For
Readers with some prior programming experience or with a science, technology, engineering, or mathematics (STEM) background, who want to gain a solid foundation with C# 8.0 and .NET Core 3.0.
▶What this book covers
- Chapter 1, Hello, C#! Welcome, .NET!, is about setting up your development environment and using Visual Studio Code to create the simplest application possible with C# and .NET. You will learn how to write and compile code on any of the supported operating systems: Windows, macOS, and Linux variants. You will also learn the best places to look for help.
- Chapter 2, Speaking C#, introduces the versions of C# and has tables of which version introduced new features, and then explains the grammar and vocabulary that you will use every day to write the source code for your applications. In particular, you will learn how to declare and work with variables of different types, and about the big change in C# 8.0 with the introduction of nullable reference types.
- Chapter 3, Controlling Flow and Converting Types, covers using operators to perform simple actions on variables including comparisons, writing code that makes decisions, repeats a block of statements, and converts between types. It also covers writing code defensively to handle errors when they inevitably occur.
- Chapter 4, Writing, Debugging, and Testing Functions, is about following the Don't Repeat Yourself (DRY) principle by writing reusable functions. You will also learn how to use debugging tools to track down and remove bugs, monitoring your code while it executes to diagnose problems, and rigorously testing your code to remove bugs and ensure stability and reliability before it gets deployed into production.
- Chapter 5, Building Your Own Types with Object-Oriented Programming, discusses all the different categories of members that a type can have, including fields to store data and methods to perform actions. You will use OOP concepts, such as aggregation and encapsulation. You will learn language features such as tuple syntax support and out variables, and default literals and inferred tuple names.
- Chapter 6, Implementing Interfaces and Inheriting Classes, explains deriving new types from existing ones using object-oriented programming (OOP). You will learn how to define operators and local functions, delegates and events, how to implement interfaces about base and derived classes, how to override a type member, how to use polymorphism, how to create extension methods, and how to cast between classes in an inheritance hierarchy.
- Chapter 7, Understanding and Packaging .NET Types, introduces the versions of .NET Core and has tables of which version introduced new features, then presents .NET Core types that are compliant with .NET Standard, and how they relate to C#. You will learn how to deploy and package your own apps and libraries.
- Chapter 8, Working with Common .NET Types, discusses the types that allow your code to perform common practical tasks, such as manipulating numbers and text, storing items in collections, and implementing internationalization.
- Chapter 9, Working with Files, Streams, and Serialization, talks about interacting with the filesystem, reading and writing to files and streams, text encoding, and serialization formats like JSON and XML.
- Chapter 10, Protecting Your Data and Applications, is about protecting your data from being viewed by malicious users using encryption and from being manipulated or corrupted using hashing and signing. You will also learn about authentication and authorization to protect applications from unauthorized users.
- Chapter 11, Working with Databases Using Entity Framework Core, explains reading and writing to databases, such as Microsoft SQL Server and SQLite, using the objectrelational mapping (ORM) technology named Entity Framework Core.
- Chapter 12, Querying and Manipulating Data Using LINQ, teaches you Language INtegrated Queries (LINQ)—language extensions that add the ability to work with sequences of items and filter, sort, and project them into different outputs.
- Chapter 13, Improving Performance and Scalability Using Multitasking, discusses allowing multiple actions to occur at the same time to improve performance, scalability, and user productivity. You will learn about the async Main feature and how to use types in the System.Diagnostics namespace to monitor your code to measure performance and efficiency.
- Chapter 14, Practical Applications of C# and .NET, introduces you to the types of crossplatform applications that can be built using C# and .NET.
- Chapter 15, Building Websites Using ASP.NET Core Razor Pages, is about learning the basics of building websites with a modern HTTP architecture on the server-side using ASP.NET Core. You will learn how to implement the ASP.NET Core feature known as Razor Pages, which simplifies creating dynamic web pages for small websites.
- Chapter 16, Building Websites Using the Model-View-Controller Pattern, is about learning how to build large, complex websites in a way that is easy to unit test and manage with teams of programmers using ASP.NET Core MVC. You will learn about startup configuration, authentication, routes, models, views, and controllers.
- Chapter 17, Building Websites Using a Content Management System, explains how a web Content Management System (CMS) can enable developers to rapidly build websites with a customizable administration user interface that non-technical users can use to create and manage their own content. As an example, you will learn about a simple open source .NET Core-based one named Piranha CMS.
- Chapter 18, Building and Consuming Web Services, explains building backend REST architecture web services using ASP.NET Core Web API and how to properly consume them using factory-instantiated HTTP clients.
- Chapter 19, Building Intelligent Apps Using Machine Learning, introduces you to Microsoft's open source ML.NET package of machine learning algorithms, which can be used to embed adaptive intelligence into any cross-platform .NET app, such as a digital commerce website that provides product recommendations for visitors to add to their shopping cart.
- Chapter 20, Building Windows Desktop Apps, is the first of two chapters about topics that go beyond what is achievable using cross-platform .NET Core and Visual Studio Code. This chapter introduces you to how .NET Core 3.0 and its Windows Desktop Pack enable Windows Forms and WPF apps to benefit from running on .NET Core. You will then learn the basics of XAML, which can be used to define the user interface for a graphical app for Windows Presentation Foundation (WPF) or the Universal Windows Platform (UWP). You will apply principles and features of Fluent Design to light up a UWP app. The apps for this chapter must be built using Visual Studio 2019 on Windows 10.
- Chapter 21, Building Cross-Platform Mobile Apps Using Xamarin.Forms, introduces you to taking C# mobile by building a cross-platform app for iOS and Android. The app for this chapter will be built using Visual Studio 2019 for Mac on macOS.