Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apps and Services with .NET 7

You're reading from  Apps and Services with .NET 7

Product type Book
Published in Nov 2022
Publisher Packt
ISBN-13 9781801813433
Pages 814 pages
Edition 1st Edition
Languages
Author (1):
Mark J. Price Mark J. Price
Profile icon Mark J. Price
Toc

Table of Contents (23) Chapters close

Preface 1. Introducing Apps and Services with .NET 2. Managing Relational Data Using SQL Server 3. Managing NoSQL Data Using Azure Cosmos DB 4. Benchmarking Performance, Multitasking, and Concurrency 5. Implementing Popular Third-Party Libraries 6. Observing and Modifying Code Execution Dynamically 7. Handling Dates, Times, and Internationalization 8. Protecting Your Data and Applications 9. Building and Securing Web Services Using Minimal APIs 10. Exposing Data via the Web Using OData 11. Combining Data Sources Using GraphQL 12. Building Efficient Microservices Using gRPC 13. Broadcasting Real-Time Communication Using SignalR 14. Building Serverless Nanoservices Using Azure Functions 15. Building Web User Interfaces Using ASP.NET Core 16. Building Web Components Using Blazor WebAssembly 17. Leveraging Open-Source Blazor Component Libraries 18. Building Mobile and Desktop Apps Using .NET MAUI 19. Integrating .NET MAUI Apps with Blazor and Native Platforms 20. Introducing the Survey Project Challenge 21. Epilogue 22. Index

Implementing gRPC JSON transcoding

JSON is the most popular format for services that return data to a browser or mobile device. It would be great if we could create a gRPC service and magically make it callable via non-HTTP/2 using JSON. Thankfully, there is a solution.

Microsoft has a new technology they have named gRPC JSON transcoding, which is an ASP.NET Core extension that creates HTTP endpoints with JSON for gRPC services, based on Google’s HttpRule class for their gRPC Transcoding. You can read about that at the following link: https://cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.HttpRule.

Enabling gRPC JSON transcoding

Let’s see how to enable gRPC JSON transcoding in our gRPC service:

  1. In the Northwind.Grpc.Service project, add a package reference for gRPC JSON transcoding, as shown highlighted in the following markup:
    <ItemGroup>
      <PackageReference Include="Grpc.AspNetCore&quot...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime