Key Features:
- Explore the ins and outs of Blazor architecture and gain a comprehensive understanding of its components.
- Dive deep into the intricacies of Blazor deployment, ensuring smooth and successful launches.
- Uncover valuable tips and tricks for optimizing performance, ensuring scalability, and enhancing security.
Description:
Building Modern Web Applications with ASP.NET Core Blazor is the ultimate guide to developing high-quality web applications with Blazor and .NET Core. Written by an experienced developer, this book provides a comprehensive overview of Blazor's architecture, components, deployment options, and best practices for optimizing performance and scalability.
It begins by introducing WebAssembly, the technology that makes Blazor possible. It then discusses the different hosting models available for Blazor applications. Next, the book covers the basics of building Blazor applications, including how to create components, handle user input, and navigate between pages. The book then delves into more advanced topics, such as uploading and downloading files, using .NET and jаvascript interoperability, connecting to the world with HTTP, persisting data with EF Core, and protecting your application with identity. Finally, the book shows you how to deploy your Blazor application with Docker and Kubernetes.
This book covers many different aspects of developing Blazor applications, a modern way to build rich UI web applications. And this book introduces how to leverage .NET and its eco-systems to build a modern enterprise application. This book will introduce WebAssembly and how it enables web applications to be written in any programming language. It also compares different Blazor hosting models and the strategy to select a model that suits that business requirements.
This book takes a demonstrative approach for Blazor learners. Every chapter comes with a lot of code examples and Blazor source code analysis. It covers basic Blazor directives and components and how these concepts can be combined together to build a more complex customized component. This book also explains some advanced techniques to control component rendering and improve performance.
This book is divided into 13 It will start with the introduction of WebAssembly and cover the basic concepts in Blazor Framework and some advanced techniques you may find handy when developing production-ready applications, as well as explaining source code structures and designing patterns and styles.
By the end of the book, you will be able to build modern, interactive web applications using Blazor and .NET Core.
What you will learn:
- Gain the ability to develop interactive web applications effortlessly, while building a strong sense of confidence.
- Get familiar with the components model, common design patterns, and solutions implemented in Blazor.
- Learn how to seamlessly integrate and reuse legacy code by leveraging jаvascript interop capabilities within Blazor.
- Discover optimization techniques and best practices for enhancing application performance and scalability.
- Develop a solid grasp of key concepts in .NET Core backend development, including protocols and middleware.
Who this book is for:
Whether you're a seasoned developer or just starting, this book will provide you with the knowledge and skills you need to master Blazor and build powerful web applications. Familiarity with fundamental web development concepts, including HTML, CSS, and jаvascript, is assumed.
Author(s): Brian Ding
Publisher: BPB Publications
Year: 2023
Language: English
Pages: 303
1. WebAssembly Introduction
Introduction
Structure
Objectives
What is WebAssembly
History of WebAssembly
Hello World with WebAssembly
Call WebAssembly from JavaScript
WebAssembly in the future
Popular WebAssembly languages
.NET Core
ASP.NET Core
When to choose ASP.NET Core Blazor
Conclusion
2. Choose Your Hosting Model
Introduction
Structure
Objectives
WebSocket
SignalR
Blazor Server
Blazor WebAssembly
Blazor Hybrid
Conclusion
3. Implementing Razor and Other Components
Introduction
Structure
Objectives
Razor components
Directive
Directive Attribute
One-way Binding
Binding Event
Binding Format
Unparsed value
Two-way binding
Cascading
Event Handling
Lifecycle
Layout
Libraries
Fast-blazor
MatBlazor
Ant Design Blazor
BootstrapBlazor
Conclusion
4. Advanced Techniques for Blazor Component Enhancement
Introduction
Structure
Component Reference
Components preserving
Template components
CSS Isolation
Conclusion
5. File Uploading in Blazor
Introduction
Structure
Objectives
Build comments for EShop
File transfer
File upload
Tips
Conclusion
6. Serving and Securing Files in Blazor
Introduction
Structure
Objectives
Middleware
Serve Static Files
Serve Dynamic Files
Security Advice
Conclusion
7. Collecting User Input with Forms
Introduction
Structure
Objectives
Forms
EditForm
InputBase
Validation
Custom Validation
Form submission
EditContext And Form State
Conclusion
8. Navigating Over Application
Introduction
Structure
Objectives
Router
RouteAttribute
NavLink
Route parameters
Navigation events and Asynchronous navigation
ASP.NET Core integration
Conclusion
9. .NET and JavaScript Interop
Introduction
Structure
Objectives
Serialization
Loading JavaScript
Initializer
Calling JavaScript from .NET
JavaScript isolation
Calling .NET from JavaScript
Cache
Element reference
Type safety
Conclusion
10. Connecting to the World with HTTP
Introduction
Structure
Objectives
Front-end and back-end separation
HTTP protocol
CORS
HttpClient
HttpClientFactory
HttpClient again
gRPC
Conclusion
11. Data Persistence with EF Core
Introduction
Structure
Objectives
Stateless and Stateful
EntityFramework Core
Context object
Data entities
Database migration
Data update
Data query
Conclusion
12. Protecting Your Application with Identity
Introduction
Structure
Objectives
Authentication
AuthenticationStateProvider
Authorization
Role-based Authorization
Policy-based Authorization
ASP.NET Core Identity
Conclusion
13. Deploying with Docker and Kubernetes
Introduction
Structure
Objectives
What is Docker
Building Docker Image
Image layer
What is K8S
K8S components
Deploy to AKS – K8S on Azure
Conclusion
Index