𝔖 Scriptorium
✦   LIBER   ✦

📁

Beginning gRPC with ASP.NET Core 6: Build Applications using ASP.NET Core Razor Pages, Angular, and Best Practices in .NET 6

✍ Scribed by Anthony Giretti


Publisher
Apress
Year
2022
Tongue
English
Leaves
484
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Broaden your developer experience by learning how to use gRPC and ASP.NET Core together on the Microsoft’s developer framework, .NET 6 and discover a new way of developing APIs with gRPC.
Beginning gRPC with ASP.NET Core 6 is your guide to quickly and efficiently getting down to the business of building gRPC applications in the Microsoft .NET ecosystem. Readers will dive in and build an application using gRPC and the latest technologies such Angular and ASP.NET Core Razor Pages.
This book will teach you how to set up an efficient application using industry best practices such as security, monitoring, logging, and more. You will do this by performing Create, Read, Update, and Delete (CRUD) operations on a SQL Server database with Entity Framework Core. From there you will build web applications using Angular and ASP.NET Core Razor pages combined with gRPC APIs.
After reading the book, you’ll be able to take advantage of the full range of developer opportunities with gRPC, and come away with any understanding of which usage scenarios are best suited for your projects. And you will possess a solid understanding of the best way to build APIs with ASP.NET Core.
What You Will Learn
Discover the latest .NET 6 framework
Benefit from a new way to design APIs
Build modern web applications
Migrate easily from WCF to gRPC
Become comfortable with latest industry programming standards

✦ Table of Contents


Table of Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Welcome to Modern .NET
A Brief History of .NET
.NET Framework
.NET Core
.NET Standard
Modern .NET: A Unified Platform
Mono and CoreCLR
Differences and Commonalities
JIT
AOT
The Best of Both Worlds
.NET Schedule and What It Means
How to Explore .NET 6
.NET 5 and 6 Improvements
Get Started with .NET 6
Recap of C# 9 and Introduction to C# 10
Recap of C# 9
Init-Only Properties
Records
Improved Pattern Matching
Improved Target Typing
Covariant Returns
Static Anonymous Functions
Top-Level Programs
Introduction to C# 10
Global Usings
File-Scoped Namespaces
Record struct
Summary
Chapter 2: Introducing ASP.NET Core 6
ASP.NET Core Fundamentals
ASP.NET Core Web API
ASP.NET Core MVC
ASP.NET Core Razor Pages
ASP.NET Core Blazor
ASP.NET Core SignalR
ASP.NET Core gRPC
ASP.NET Core Minimal APIs
Summary
Chapter 3: Understanding the gRPC Specification
Introduction to Remote Procedure Calls
gRPC Concepts
Protocol Buffers
gRPC Channel
Types of gRPC Services
Unary Calls
Server-Streaming Calls
Client-Streaming Calls
Bidirectional Streaming Calls
Trailers
gRPC Status
Deadline and Cancellation
gRPC Requests and Responses over HTTP/2
Introduction to the HTTP/2 Protocol
Multiplexing
Compression and Binary Data Transport
Flow Control
Server Push
Benefits, Drawbacks, and Use Cases
Benefits
Drawbacks
Use Cases
Summary
Chapter 4: Protobufs
About Protocol Buffers
Individual Declarations
Services Declaration
Messages Declaration
Scalar Type Values
Collections
Lists
Dictionaries
Enumerations
Nested Types
Import Types
Any, Value, Struct, Wrappers, Dates, and  Times (Well-Known Types)
Any
Wrappers
Value
Dates and Times
Bytes
One of
Empty Messages
Comments
Summary
Chapter 5: Creating an ASP.NET Core gRPC Application
Create an ASP.NET Core gRPC Application
Create and Compile Protobuf Files
Write, Configure, and Expose gRPC Services
Test Using gRPCurl and gRPCui Tools
gRPCurl
gRPCui
TLS Certificates
Manage Errors, Handle Responses, and Perform Logging
Perform Message Validation
Support of ASP.NET Core gRPC on Microsoft Azure
Summary
Chapter 6: API Versioning
Version gRPC Services
Expose the Versions of Your Protobuf with ASP.NET Core Minimal APIs
Summary
Chapter 7: Create a gRPC Client
Create a Console Application
Compile Protobuf Files and Generate gRPC Clients
Consume gRPC Services with .NET 6
Optimize Performance
Take Advantage of Compression
Define a Limit to Message Size
Keep HTTP/2 Connections Open
Increase HTTP/2 Maximum Connections
Get Message Validation Errors from the Server
Summary
Chapter 8: From WCF to gRPC
Differences and Similarities Between WCF and gRPC
What and What Not to Migrate from WCF to gRPC
Summary
Chapter 9: Import and Display Data with ASP.NET Core Razor Pages, Hosted Services, and gRPC
Scenario Explanation
Create and Layer the ASP.NET Core gRPC Application
Set Up a SQL Server Database and Use Entity Framework Core to Access Data
Set Up a SQL Server Database
Using Entity Framework Core to Access Data
Design the Database by Code
Seed the Database by Code
Query the Database with LINQ Queries
Write the Business Logic and Expose the Country gRPC Microservice
Write the Business Logic into the CountryService.BLL Layer
Write the Country gRPC Service
Create and Layer the ASP.NET Core Razor Application
Create the Application Skeleton
Define Contracts and Domain Objects
Implement the Data Access Layer with the gRPC Client
Implement the Business Logic Layer
Configure the ASP.NET Core Razor Pages Application
Create a Background Task for Handling Uploaded File Data and Create a Channel to Store Data
Create and Configure the gRPC Client with the IHttpClientFactory and Register All Dependencies in the Program.cs File
Upload a Data File with a Form, Display and Manage Data on Razor Pages
Summary
Chapter 10: The gRPC-web Specification
History and Specification of gRPC-web
History of gRPC-web
The gRPC-web Specification
The gRPC-web JavaScript Libraries
gRPC-web vs. REST APIs
Summary
Chapter 11: Create a gRPC-web service from a gRPC-service with ASP.NET Core
Working with gRPC-web and the .NET Ecosystem
gRPC-web and ASP.NET Core 6
gRPC-web and All .NET Clients
gRPC-web and ASP.NET Core 3+ Clients
Reworking the CountryService gRPC service for Browser Apps
Support of ASP.NET Core gRPC-web on Microsoft Azure
Summary
Chapter 12: Import and Display Data with Angular 12 and gRPC-web
Introduction to SPAs
Generate TypeScript Stubs with Protoc
Download the Correct Version of Protoc and Protobuf Well-Known Types
Download the ts-protoc-gen Plug-in
Download Improbable’s gRPC-web Library and Google Protobufs Library
Executing the Protoc Command
Write Data Access with Improbable’s gRPC-web Client
Upload a Data File and Display Data with TypeScript, a Web Worker, and gRPC-web
Manage Data with TypeScript and gRPC-web
Summary
Chapter 13: Secure Your Application with OpenId Connect
Introduction to OpenId Connect
Configure ASP.NET Core
Use gRPCurl and gRPCui with a JWT
gRPCurl
gRPCui
Use a C# Client with a JWT
Use a gRPC-web Client with a JWT
Get User Identity Server Side
Summary
Index


📜 SIMILAR VOLUMES


Building real life web apps with Angular
✍ Haris Tsetsekas 📂 Library 🌐 English

<span>This book aims to help readers learn Angular 14 and ASP.NET Core 6 by developing a real-life project. Readers will get a step-by-step introduction to the most important features of both frameworks by working in project iterations, covered in each book chapter.<br>The book goes beyond the basic

ASP.NET Core Razor Pages in Action
✍ Mike Brind 📂 Library 🏛 Manning 🌐 English

<span>Razor Pages lets you build, configure, and deploy amazing dynamic ASP.NET websites with ease.</span><span><br><br>In ASP.NET Core Razor Pages in Action you will learn:<br> <br> Building, configuring, and publishing a data-driven website<br> Creating a complete web application step-by-step<br>