Building Blazor WebAssembly Applications with gRPC Learn how to implement source generators and gRPC in your Blazor apps for better performance
Explore the power of Blazor WebAssembly, gRPC, and source generators for easy and quick web development Key Features Get to grips with integration between Blazor, gRPC, and source generators in real-life projectsDevelop a complete Blazor WebAssembly project that takes advantage of gRPC’s capabilitie...
Uloženo v:
| Hlavní autor: | |
|---|---|
| Médium: | E-kniha |
| Jazyk: | angličtina |
| Vydáno: |
Birmingham
Packt Publishing
2022
Packt Publishing, Limited Packt Publishing Limited |
| Vydání: | 1 |
| Témata: | |
| On-line přístup: | Získat plný text |
| Tagy: |
Přidat tag
Žádné tagy, Buďte první, kdo vytvoří štítek k tomuto záznamu!
|
Obsah:
- Table of Contents Introducing Blazor, gRPC, and Source GeneratorsCreating a Blazor WebAssembly ApplicationCreating a Database Using Entity Framework CoreConnecting Client and Server with REST APIBuilding gRPC ServicesDiving Deep into Source GeneratorsBest Practices for C# and gRPC
- Creating entities in the database -- Using generic services for data manipulation -- Creating models -- Mappings between models -- Creating data services -- Creating a new record -- Reading a single record -- Reading all records -- Updating records -- Deleting records -- Registering data services -- Summary -- Further reading -- Chapter 4: Connecting Client and Server with REST API -- Technical requirements -- Exposing CRUD operations in API controllers -- Consuming a REST API in Blazor components -- Creating and editing data -- Viewing the data -- Extending the demo project -- Summary -- Chapter 5: Building gRPC Services -- Technical requirements -- What are the benefits of using gRPC services? -- How does communication work in gRPC? -- Understanding the protocol buffer language -- Creating messages -- Field types -- Default values -- The reserved keyword -- Defining methods -- gRPC services in C# -- Two ways of implementing -- Implementing gRPC services using .proto files -- Creating Blazor components -- Preparation for generic components -- Creating generic list components -- Creating generic form components -- Summary -- Chapter 6: Diving Deep into Source Generators -- Technical requirements -- What can source generators generate? -- What is a syntax tree? -- What is a semantic model? -- Implementing source generators -- Using partial classes and methods -- Partial classes -- Partial methods -- Creating attributes for your needs -- Writing the first generator -- Required packages -- Limiting the generator -- Generating the code -- Referencing the generators -- Exploring generated code -- Summary -- Chapter 7: Best Practices for C# and gRPC -- gRPC is not the new REST -- Generated code can be harder to debug -- Exploring generated code -- Using a debugger -- Emitting generated files -- Testing the generator -- Type less, generate more -- Summary
- Cover -- Title Page -- Copyright and Credits -- Contributors -- Table of Contents -- Preface -- Chapter 1: Introducing Blazor, gRPC, and Source Generators -- Technical requirements -- Using the Blazor framework to create websites -- Using Blazor WebAssembly for single-page applications -- Harnessing advantages of progressive web applications using Blazor -- Understanding how Blazor uses Razor syntax -- Using JavaScript in Blazor -- Understanding the REST API as the default Blazor communication interface -- Understanding gRPC and how it is different from REST -- How protocol buffers work -- Why we still use REST -- What are source generators and how do they work? -- Summary -- Further reading -- Chapter 2: Creating a Blazor WebAssembly Application -- Technical requirements -- Learning how to write Razor syntax -- Writing implicit Razor expressions -- Writing explicit Razor expressions -- Writing inline expressions -- Writing code block expressions -- Writing control structures -- Writing top-level directives -- Writing inline directives -- Creating Razor components -- Using components in other components -- Passing parameters to components -- Creating components with child content -- Communicating with the parent component -- Understanding the component life cycle -- Structuring component code -- Understanding page routing in Blazor -- Navigating between pages -- Page directive -- Route constraints -- Catch-all parameters -- Project overview and preparation -- Creating a demo Blazor WebAssembly project -- Examining the project -- Preparing the demo project -- Summary -- Chapter 3: Creating a Database Using Entity Framework Core -- Technical requirements -- Creating a data repository using EF -- Installing NuGet packages -- Enabling EF -- Creating database representation in C# -- Configuring EF Core -- Migrating code to the database
- Index -- Other Books You May Enjoy
- Building Blazor WebAssembly Applications with gRPC: Learn how to implement source generators and gRPC in your Blazor apps for better performance

