Building a Web App with Blazor and ASP .Net Core
US$ 19.95
The publisher has enabled DRM protection, which means that you need to use the BookFusion iOS, Android or Web app to read this eBook. This eBook cannot be used outside of the BookFusion platform.
Description
Contents
Reviews
Language
English
ISBN
9789389845457
Cover Page
Title Page
Copyright Page
Dedication
About the Author
About the Reviewer
Acknowledgement
Preface
Errata
Table of Contents
1. An Introduction to Blazor
Introduction
Objectives
What is Web Assembly?
Security considerations
WebAssembly limitations
Facts about WebAssembly
Is WASM kill JavaScript?
Is WASM a new programming language?
Can other programming languages write WASM code other than C and Rust?
Is it an upgraded version of Silverlight?
What is Blazor?
Interpreted mode
Ahead-of-time compiled mode
Features of Blazor
Blazor (client) supported platforms
Prerequisite Blazor development
.NET Core Framework (.NET Core SDK)
Integrated Development Environment - IDE
Creating first Blazor application
Creating a project with Visual Studio 2019
Creating a project using dotnet CLI
Understand project structure and component
Understand Blazor booting process
Render tree in Blazor application
Blazor client-side
Blazor server side
Summary
What did you learn in this chapter?
What next?
Questions
2. Components and Structure for Blazor Applications
Introduction
Objectives
What is the Blazor component?
Create Blazor component
Using a single file - inline
Component with code behind
Class only component
Life Cycle methods of component
OnInitialized and OnInitializedAsync
OnParametersSet and OnParametersSetAsync
OnAfterRender and OnAfterRenderAsync
SetParametersAsync
StateHasChanged
Dispose component with IDisposable
Component parameters
Child component
Templated components
Grid view template example
List view template example
Define template inline - using Razor template syntax
Cascading values
Declaring HTML attributes using parameters
Import components
Summary
What did you learn in this chapter?
What next?
Questions
3. Blazor Concepts
Introduction
Objectives
Data Binding
One-way data binding
Two-way data binding
Event Binding
Event Callback
Layouts
Introduction to Layouts page
Specify a layout in a component
Define layout globally
Nested layouts
Example
Routing
@page directive/route attribute
Example
Route parameters
Route constraints
Example
Programmatically navigate one component to another component
Query parameters
Forms and validation
Data annotations
Summary
What do you learn in this chapter?
What is next?
Questions
4. Dependency Injection
Introduction
Objective
Types of dependency injection
Construction injection
Setter injection
Interface based injection
Service lifetime
Scoped
Singleton
Transient
Add services to the application
Default services
Inject the service in the component
Example of adding service as a dependency
Use dependency in services
Using OwningComponentBase
Summary
What you learned in this chapter?
What next?
Questions
5. JavaScript Interop
Introduction
Objective
What is JavaScript Interop?
Invoke JavaScript functions from C# (.NET) methods
Invoke C# (.NET) methods from JavaScript
Capture references to elements
Detect when a Blazor app is pre-rendering
Share interop code in a class library
Summary
What you learned in this chapter?
What next?
Questions
6. State Management
Introduction
Objectives
Understand Blazor circuits
Preserve state across circuits
Where to persist state
On server in database
On client in the browser
URL
Third-party browser storage solutions
Summary
What you learned in this chapter?
What next?
Questions
7. Authentication and Authorization
Introduction
Objective
Authentication
AuthenticationStateProvider service
Custom AuthenticationStateProvider
Authorization
AuthorizeView
Authorize attribute
Custom content for unauthorized router component
Authorization rules check-in procedural logic
Authorization in Blazor client-side apps
Authentication using third party service
Using Microsoft API
Using Google API
Using Facebook API
Use multiple authentication providers together
Summary
What you learned in this chapter?
What next?
Questions
8. Handle Exception and Log Error
Introduction
Objective
The behavior of Blazor app for an unhandled exception
Places where errors may occur
Component instantiation
Lifecycle methods
Rendering logic
Component disposal
JavaScript interop
Event handlers
Circuit handlers and disposal
Prerendering
Enabling detailed errors
Introduction to the logging framework
Configure logging provider
Set default minimum log level
Logging using serilog
Write log to file using serilog
Summary
What you learned in this chapter?
What next?
Questions
9. Getting Started with Blazor Using Visual Studio 2019
Introduction
Objective
Setting up the Blazor development environment using Visual Studio 2019
Creating a single page application using Blazor
Scaffolding the model using EF Core
CRUD operation with EF in Blazor server app
Create Add/Edit page with validation
Delete customer
Installed project template for Blazor
Summary
What you learned in this chapter?
What next?
Questions
10. Hosting and Deployment
Introduction
Objective
Publish Blazor server app
Deploying Blazor app on IIS
Prerequisites
Configure IIS
Deploying Blazor app on Azure
Prerequisites
Deploy app on Azure as app service
Create publish profile with create app service or selecting existing one
Sign in using Azure account
Configure App Service.
Publish application on app service
Create database server and database on Azure
Login to Azure portal and select SQL databases from the left menu
Create a database
Get connection string
Configure firewall for SQL server
Summary
What you learned in this chapter?
Questions
Loading...