Apps and Services with .NET 7: Build practical projects with Blazor, .NET MAUI, gRPC, GraphQL, and other enterprise technologies
- Length: 115 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2022-12-09
- ISBN-10: 1801813434
- ISBN-13: 9781801813433
- Sales Rank: #1092890 (See Top 100 Books)
Bestselling author Mark Price is back to guide you through the coolest and most common technologies a .NET developer should know: Blazor, .NET MAUI, gRPC, GraphQL, SQL Server, Cosmos DB, OData, SignalR, Azure Functions, and more!
Key Features
- Build services using a variety of technologies including Web API, OData, gRPC, GraphQL, SignalR, and Azure Functions
- Learn how to use specialized libraries to improve all aspects of your applications, including performance and localization
- Leverage .NET MAUI to develop cross-platform desktop and mobile apps with ease
Book Description
Apps and Services with .NET 7 is for developers who want to kick their C# and .NET understanding up a gear by learning the practical skills and knowledge they need to build real-world applications and services. It covers specialized libraries that will help you monitor and improve performance, secure your data and applications, and internationalize your code and apps.
With chapters that put a variety of technologies into practice, including Web API, OData, gRPC, GraphQL, SignalR and Azure Functions, this book will give you a broader scope of knowledge than other books that often focus on only a handful of .NET technologies. It covers the latest developments, libraries, and technologies that will help keep you up to date.
You’ll also leverage .NET MAUI to develop mobile apps for iOS and Android as well as desktop apps for Windows and macOS.
By the end of this book, you’ll have a wide range of best practices and deep insights under your belt to help you build rich apps and efficient services.
What you will learn
- Learn how to build more efficient, secure, and scalable apps and services
- Leverage specialized .NET libraries to improve your applications
- Implement popular third-party libraries like Serilog and FluentValidation
- Build cross-platform apps with .NET MAUI and integrate with native mobile features
- Get familiar with a variety of technologies for implementing services like gRPC and GraphQL
- Explore Blazor WebAssembly and use open-source Blazor component libraries
- Store and manage data locally and in the cloud with SQL Server and Cosmos DB
Who This Book Is For
This book is for .NET developers interested in exploring more specialized libraries and implementation fundamentals behind building services and apps.
You’ll need to know your way around .NET and C# quite well before you can dive in, so if you want to work your way up to this book, pick up Mark’s other .NET book, C# 11 and .NET 7 – Modern Cross-Platform Development Fundamentals, first.
Apps and Services with .NET 7: Build practical projects with Blazor, .NET MAUI, gRPC, GraphQL, and other enterprise technologies 1 Introducing Apps and Services with .NET Join our book community on Discord Introducing this book and its contents A companion book to continue your learning journey What you will learn in this book My learning philosophy Fixing my mistakes Setting up your development environment Choosing the appropriate tool and application type for learning Deploying cross-platform Downloading and installing Visual Studio 2022 for Windows Downloading and installing Visual Studio Code Understanding the solution code on GitHub What’s new in C# and .NET? Understanding .NET support Understanding .NET Runtime and .NET SDK versions What’s new in C# 8 and .NET Core 3? What’s new in C# 9 and .NET 5? What’s new in C# 10 and .NET 6? What’s new in C# 11 and .NET 7? Using other project templates Installing additional template packs Making good use of the GitHub repository for this book Raising issues with the book Giving me feedback Downloading solution code from the GitHub repository Where to go for help Reading Microsoft documentation Getting help for the dotnet tool Searching for answers using Google Subscribing to the official .NET blog Watching Scott Hanselman's videos Practicing and exploring Exercise 1.1 – Test your knowledge Exercise 1.2 – Explore topics Summary 2 Working with Data Using SQL Server Join our book community on Discord Understanding modern databases Using a sample relational database Connecting to a SQL Server database Installing and setting up Microsoft SQL Server Installing Microsoft SQL Server Developer edition for Windows Visual Studio Code extension for working with SQL Server Creating the Northwind sample database Setting up Azure SQL Database Installing Azure SQL Edge in Docker Managing data with low level APIs Understanding the types in ADO.NET Creating a console app for working with ADO.NET Executing queries and working with data readers using ADO.NET Working with ADO.NET asynchronously Executing stored procedures using ADO.NET Managing data with EF Core Understanding Entity Framework Core Scaffolding models using an existing database Setting up the dotnet-ef tool 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 Defining the Northwind database model Querying the Northwind model Building a reusable entity data model Creating a class library for entity models using SQL Server Creating a class library for the data context using SQL Server Creating a test project to check the integration of theclass libraries Writing unit tests for entity models Running unit tests using Visual Studio 2022 Running unit tests using Visual Studio Code Cleaning up data resources Removing Azure resources Removing Docker resources Practicing and exploring Exercise 2.1 – Test your knowledge Exercise 2.2 – Practice benchmarking ADO.NET against EF Core Exercise 2.3 – Explore topics Summary 3 Working with Data Using Microsoft Azure Cosmos DB Join our book community on Discord Understanding NoSQL databases Understanding Azure Cosmos DB and its APIs Understanding document modelling Understanding consistency levels Understanding the hierarchy of components Understanding throughput provisioning Understanding partition strategies Understanding data storage design Migrating data to Azure Cosmos DB Creating Azure Cosmos DB resources Using an emulator on Windows to create Azure Cosmos DB resources Using the Azure portal to create Azure Cosmos DB resources Using a .NET app to create Azure Cosmos DB resources Manipulating data with Core (SQL) API Performing CRUD operations with Cosmos SQL API Understanding SQL queries Understanding server-side programming Manipulating graph data with Gremlin API Comparing relational and graph databases Defining a graph model using Gremlin API Cleaning up Azure resources Practicing and exploring Exercise 3.1 – Test your knowledge Exercise 3.2 – Practice data modelling and partitioning Exercise 3.3 – Explore topics Exercise 3.4 – Explore NoSQL databases Summary 4 Improving Performance and Scalability Using Multitasking Join our book community on Discord Understanding processes, threads, and tasks Monitoring performance and resource usage Evaluating the efficiency of types Monitoring performance and memory using diagnostics Measuring the efficiency of processing strings Monitoring performance and memory using Benchmark.NET Running tasks asynchronously Running multiple actions synchronously Running multiple actions asynchronously using tasks Waiting for tasks Continuing with another task Nested and child tasks Wrapping tasks around other objects Synchronizing access to shared resources Accessing a resource from multiple threads Applying a mutually exclusive lock to a conch Synchronizing events Making CPU operations atomic Applying other types of synchronization Understanding async and await Improving responsiveness for console apps Working with async streams Improving responsiveness for GUI apps Improving scalability for web applications and web services Common types that support multitasking Using await in catch blocks Practicing and exploring Exercise 4.1 – Test your knowledge Exercise 4.2 – Explore topics Summary 5 Using Popular Third-Party Libraries Join our book community on Discord Which third-party libraries are most popular? What is covered in my books What could be covered in my books Working with images Generating greyscale thumbnails ImageSharp packages for drawing and the web Logging with Serilog Understanding Serilog sinks Logging to the console and a rolling file with Serilog Mapping between objects Testing an AutoMapper configuration Performing live mappings between models Making fluent assertions in unit testing Making assertions about strings Making assertions about collections and arrays Making assertions about dates and times Validating data Understanding the built-in validators Performing custom validation Customizing validation messages Defining a model and validator Testing the validator Integrating with ASP.NET Core Generating PDFs Practicing and exploring Exercise 5.1 – Test your knowledge Exercise 5.2 – Explore topics Summary 6 Controlling the Roslyn Compiler, Reflection, and Expression Trees Join our book community on Discord Working with reflection and attributes Versioning of assemblies Reading assembly metadata Creating custom attributes Understanding compiler-generated types and members Making a type or member obsolete Doing more with reflection Working with expression trees Understanding components of expression trees Executing the simplest expression tree Creating source generators Implementing the simplest source generator Doing more with source generators Practicing and exploring Exercise 6.1 – Test your knowledge Exercise 6.2 – Explore topics Summary 7 Handling Dates, Times, and Internationalization Join our book community on Discord Working with dates and times Specifying date and time values Formatting date and time values Date and time calculations Globalization with dates and times Working with only a date or a time Working with time zones Understanding DateTime and TimeZoneInfo Exploring DateTime and TimeZoneInfo Working with cultures Detecting and changing the current culture Localizing your user interface Defining and loading resources Testing globalization and localization Practicing and exploring Exercise 2.1 – Test your knowledge Exercise 2.2 – Explore topics Exercise 2.3 – Watch Jon Skeet's presentation Summary 8 Protecting Your Data and Applications Join our book community on Discord Understanding the vocabulary of protection Keys and key sizes IVs and block sizes Salts Generating keys and IVs Encrypting and decrypting data Encrypting symmetrically with AES Hashing data Hashing with the commonly used SHA256 Signing data Signing with SHA256 and RSA Generating random numbers Generating random numbers for games and similar apps Generating random numbers for cryptography Authenticating and authorizing users Authentication and authorization mechanisms Implementing authentication and authorization Protecting application functionality Real-world authentication and authorization Practicing and exploring Exercise 8.1 – Test your knowledge Exercise 8.2 – Practice protecting data with encryption and hashing Exercise 8.3 – Practice protecting data with decryption Exercise 8.4 – Explore topics Exercise 8.5 – Review Microsoft encryption recommendations Summary 9 Building and Securing Web Services with Minimal APIs Join our book community on Discord Building web services using ASP.NET Core Minimal APIs Understanding Minimal APIs route mappings Understanding parameter mapping Understanding return values Documenting a Minimal APIs service Setting up a ASP.NET Core Web API project Testing web services using Visual Studio Code extensions Excluding paths from OpenAPI documentation Relaxing the same origin security policy using CORS Configuring HTTP logging for the web service Creating a web page JavaScript client Creating a .NET client Understanding CORS Enabling CORS for specific endpoints Understanding other CORS policy options Preventing denial of service attacks using rate limiting Rate limiting using ASP.NET Core middleware Rate limiting using the AspNetCoreRateLimit package Creating a rate limited console client Understanding identity services Authenticating service clients using JWT bearer authentication Practicing and exploring Exercise 9.1 – Test your knowledge Exercise 9.2 – Practice ??? Exercise 9.3 – Explore topics Summary 10 Exposing Data via the Web Using OData Join our book community on Discord Understanding OData Understanding the OData standard Understanding OData queries Building a web service that supports OData Defining OData models for the EF Core models Testing the OData models Creating and testing OData controllers Testing OData services using Visual Studio Code extensions Querying OData services using REST Client Logging OData requests Versioning OData controllers Enabling entity inserts, updates, and deletes Building clients for OData services Calling services in the Northwind MVC website Revisiting the introductory query Practicing and exploring Exercise 10.1 – Test your knowledge Exercise 10.2 – Explore topics Summary 11 Combining Data Sources Using GraphQL Join our book community on Discord Understanding GraphQL Understanding GraphQL document format Understanding other GraphQL capabilities Understanding the ChilliCream GraphQL platform Building a service that supports GraphQL Defining GraphQL schema for Hello World Writing and executing GraphQL queries Naming GraphQL queries Understanding field conventions Defining GraphQL queries for EF Core models Adding support for EF Core Exploring GraphQL queries with Northwind Building a .NET client for a GraphQL service Understanding GraphQL responses Using REST Client as a GraphQL client Using an ASP.NET Core MVC project as a GraphQL client Testing the .NET client Understanding Strawberry Shake Implementing GraphQL mutations Practicing and exploring Exercise 11.1 – Test your knowledge Exercise 11.2 – Explore topics Exercise 11.3 – Practice building .NET clients Summary 12 Building Efficient Services Using gRPC Join our book community on Discord Understanding gRPC How gRPC works Defining gRPC contracts with .proto files gRPC benefits gRPC limitations Types of gRPC methods Microsoft's gRPC packages Building a gRPC service and client Building a Hello World gRPC service Building a Hello World gRPC client Testing a gRPC service and client Implementing gRPC for an EF Core model Implementing the gRPC service Implementing the gRPC client Getting request and response metadata Adding a deadline for higher reliability Implementing gRPC JSON transcoding Enabling gRPC JSON transcoding Testing gRPC JSON transcoding Comparing with gRPC-Web Practicing and exploring Exercise 12.1 – Test your knowledge Exercise 12.2 – Explore topics Summary 13 Broadcasting Realtime Communication Using SignalR Join our book community on Discord Understanding SignalR Understanding the history of real time communication on the web Understanding AJAX Understanding WebSocket Introducing SignalR Designing method signatures Building a live communication service using SignalR Defining some shared models Enabling a server-side SignalR hub Building web client using the SignalR JavaScript library Adding a chat page to the MVC website Testing the chat feature Building a .NET console app client Creating a .NET client for SignalR Testing the .NET console app client Understanding Azure SignalR Service Practicing and exploring Exercise 13.1 – Test your knowledge Exercise 13.2 – Explore topics Summary 14 Building Serverless Services Using Azure Functions Join our book community on Discord Understanding Azure Functions Understanding Azure Functions triggers and bindings Understanding NCRONTAB expressions Understanding Azure Functions versions and languages Understanding Azure Functions hosting models Understanding Azure Functions hosting plans Understanding the Azure Storage requirement Understanding and installing Azurite Understanding Azure Functions authorization levels Understanding Azure Functions support for dependency injection Installing Azure Functions Core Tools Building an Azure Functions project Using Visual Studio 2022 Using Visual Studio Code Using the func CLI Reviewing the Azure Functions project Implementing a simple function Testing a simple function Responding to timer and resource triggers Implementing a Timer triggered function Testing the Timer triggered function Implementing a function that works with queues and blobs Testing the function that works with queues and blobs Publishing an Azure Functions project to the cloud Using Visual Studio 2022 to publish Using Visual Studio Code to publish Cleaning up Azure Functions resources Practicing and exploring Exercise 14.1 – Test your knowledge Exercise 14.2 – Explore topics Exercise 14.3 – Reading more about Azure Functions Summary 15 Building Web User Interfaces Using ASP.NET Core Join our book community on Discord Setting up an ASP.NET Core MVC website Creating an ASP.NET Core MVC website Exploring the default ASP.NET Core MVC website Understanding visitor registration Reviewing an MVC website project structure Referencing an EF Core class library and registering a data context Defining web user interfaces with Razor views Understanding Razor views Prototyping with Bootstrap Understanding Razor syntax and expressions Understanding HTML Helper methods Defining a strongly-typed Razor view Localizing and globalizing with ASP.NET Core Creating resource files Localizing Razor views with an injected view localizer Understanding the Accept-Language header Defining web user interfaces with Tag Helpers Comparing HTML Helpers and Tag Helpers Exploring the Anchor Tag Helper Exploring the Cache Tag Helpers Exploring the Environment Tag Helper Understanding how the Image Tag Helper busts a cached file Exploring Forms-related Tag Helpers Practicing and exploring Exercise 15.1 – Test your knowledge Exercise 15.2 – Practice building a web user interface Exercise 15.3 – Explore topics Summary 16 Building Web Components Using Blazor WebAssembly Join our book community on Discord Understanding Blazor Understanding Blazor hosting models Understanding deployment choices for Blazor WebAssembly apps Understanding the browser compatibility analyzer for Blazor WebAssembly Understanding CSS and JavaScript isolation Understanding Blazor components Understanding Blazor routing to page components How to pass route parameters How to navigate Blazor routes to page components Building Blazor components Building and testing a Blazor progress bar component Building and testing a Blazor dialog box component Building and testing a Blazor alert component Building a Blazor data component Making the component a routable page component Getting entities into a component by building a web service Getting entities into a component by calling the web service Implementing caching using local storage Understanding interop with JavaScript modules Building a local storage service Building Progressive Web Apps Enabling offline support Practicing and exploring Exercise 16.1 – Test your knowledge Exercise 16.2 – Practice building Blazor components Exercise 16.3 – Practice building an IndexedDB interop service Exercise 16.4 – Explore topics Summary 17 Using Open Source Blazor Component Libraries Join our book community on Discord Understanding open source Blazor component libraries Exploring Radzen Blazor components Enabling Radzen dialog, notification, context menu, and tooltip components Using the Radzen tooltip and context menu components Using the Radzen notification and dialog components Building a web service for Northwind entities Using the Radzen tabs, image and icon components Using the Radzen HTML editor component Using the Radzen chart component Using the Radzen form components Practicing and exploring Exercise 17.1 – Test your knowledge Exercise 17.2 – Practice by exploring MudBlazor Exercise 17.3 – Explore topics Summary 18 Building Mobile and Desktop Apps Using .NET MAUI Join our book community on Discord Understanding XAML Simplifying code using XAML Understanding .NET MAUI namespaces Understanding type converters Choosing common controls Understanding markup extensions Understanding .NET MAUI Development tools for mobile first, cloud first Understanding .NET MAUI user interface components Understanding .NET MAUI handlers Writing platform-specific code Building mobile and desktop apps using .NET MAUI Creating a virtual Android device for local app testing Creating a .NET MAUI solution Adding shell navigation and more content pages Implementing more content pages Using shared resources Defining resources to share across an app Referencing shared resources Changing shared resources dynamically Using data binding Binding to elements Understanding MVVM Understanding the INotificationPropertyChanged interface Understanding ObservableCollection Creating a view model with two-way data binding Creating views for the customers list and customer details Testing the .NET MAUI app Consuming a web service from a mobile app Creating a minimal API web service for customers Configuring the web service to allow unsecure requests Connecting to local web services while testing Configuring the iOS app to allow unsecure connections Configuring the Android app to allow unsecure connections Getting customers from the web service Practicing and exploring Exercise 18.1 – Test your knowledge Exercise 18.2 – Explore topics Summary 19 Integrating .NET MAUI Apps with Blazor and Native Platforms Join our book community on Discord Building Hybrid .NET MAUI Blazor apps Creating a .NET MAUI Blazor project Adding a shell and .NET MAUI pages Creating a minimal API web service for categories Configuring the .NET MAUI app to allow unsecure connections Implementing the Model-View-ViewModel pattern Getting categories from the web service Integrating with native platforms Working with the system clipboard Picking files from local filesystem Creating new windows Getting device information Integrating with desktop menu bars Popping up a toast notification Integrating with geolocation and maps Using third-party control libraries Practicing and exploring Exercise 19.1 – Test your knowledge Exercise 19.2 – Explore the code samples Exercise 19.3 – Explore topics Summary
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Apps and Services with .NET 7: Build practical projects with Blazor, .NET MAUI, gRPC, GraphQL, and other enterprise technologies
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.