Blazor in Action / Blazor в действии Год издания: 2022 Автор: Chris Sainty Издательство: Manning ISBN: 9781617298646 Язык: Английский Формат: EPUB Качество: Издательский макет или текст (eBook) Интерактивное оглавление: Да Количество страниц: 380 (в бумажном варианте) Описание: Blazor in Action has been written to take you from being a beginner to being proficient and confident building Blazor applications. Initially, the book covers high-level concepts such as hosting models and components before drilling down into specific features of the framework, such as routing, forms and validation, and templated components. To help imbed the various concepts and features, you’ll build a real application—Blazing Trails—chapter by chapter. By the end of the book, you’ll have a complete reference app you can refer to anytime. This book is aimed at developers who have a basic understanding of .NET, C#, and web technologies (HTML, JavaScript, and CSS). If you’ve been building web applications using Razor Pages or MVC, then the learning curve will feel quite shallow. If you’ve been building apps using ASP.NET Core Web APIs and a JavaScript framework such as React, Vue.js, or Angular, then you’ll be in an even better position.
Примеры страниц
Оглавление1 Starting your Blazor journey 1.1 Why choose Blazor for new applications? 1.2 Components, a better way to build UI What is a component? The benefits of a component-based UI Anatomy of a Blazor component 1.3 Blazor, a platform for building modern UIs with C# Understanding hosting models Blazor WebAssembly Blazor Server Other hosting models 2 Your first Blazor app 2.1 Setting up the application Blazor WebAssembly template configurations Creating the application 2.2 Building and running the application 2.3 Key components of a Blazor application Index.html Program.cs App.razor wwwroot folder and _Imports.razor 2.4 Writing your first components Organizing files using feature folders Setting up styling Defining the layout The Blazing Trails home page 3 Working with Blazor’s component model 3.1 Structuring components Single file Partial class 3.2 Component life cycle methods The first render The life cycle with async Dispose: The extra life cycle method 3.3 Working with parent and child components Passing values from a parent to a child Passing data from a child to a parent 3.4 Styling components Global styling Scoped styling Using CSS preprocessors 4 Routing 4.1 Introducing client-side routing Blazor’s router Defining page components 4.2 Navigating between pages programmatically 4.3 Passing data between pages using route parameters 4.4 Handling multiple routes with a single component 4.5 Working with query strings Setting query-string values Retrieving query-string values using SupplyParameterFromQuery 5 Forms and validation—Part 1: Fundamentals 5.1 Super-charging forms with components Creating the model Basic EditForm configuration Collecting data with input components Creating inputs on demand 5.2 Validating the model Configuring validation rules with Fluent Validation Configuring Blazor to use Fluent Validation 5.3 Submitting data to the server Adding MediatR to the Blazor project Creating a request and handler to post the form data to the API Setting up the endpoint 136 6 Forms and validation—Part 2: Beyond the basics 6.1 Customizing validation CSS classes Creating a FieldCssClassProvider Using custom FieldCssClassProviders with EditForm 6.2 Building custom input components with InputBase Inheriting from InputBase Styling the custom component Using the custom input component 6.3 Working with files Configuring the InputFile component Uploading files when the form is submitted 6.4 Updating the form to allow editing Separating the trail form into a standalone component Refactoring AddTrailPage.razor Adding the edit trail feature Testing the edit functionality 7 Creating more reusable components 7.1 Defining templates 7.2 Enhancing templates with generics 7.3 Sharing components with Razor class libraries 8 Integrating with JavaScript libraries 8.1 Creating a JavaScript module and accessing it via a component Testing out the RouteMap component Calling JavaScript functions from C# and returning a response 8.2 Calling C# methods from JavaScript 8.3 Integrating the RouteMap component with the TrailForm 8.4 Displaying the RouteMap on the TrailDetails drawer 9 Securing Blazor applications 9.1 Integrating with an identity provider: Auth Registering applications with Auth Customizing tokens from Auth Configuring Blazor WebAssembly to use Auth Configuring ASP.NET Core WebAPI to use Auth 9.2 Displaying different UI fragments based on authentication status Updating the Home feature 9.3 Prevent unauthorized users accessing a page Securing API endpoints Calling secure API endpoints from Blazor 9.4 Authorizing users by role Adding roles in Auth Consuming Auth0 roles in Blazor WebAssembly Implementing role-based logic 10 Managing state 10.1 Simple state management using an in-memory store Creating and registering a state store Saving data entered on the form to AppState 10.2 Improving the AppState design to handle more state 10.3 Creating persistent state with browser local storage Defining an additional state store Adding and removing trails from the favorites list Displaying the current number of favorite trails Reorganizing and refactoring Showing favorited trails on the favorite trails page Initializing AppState 11 Testing your Blazor application 11.1 Introducing bUnit 11.2 Adding a bUnit test project 11.3 Testing components with bUnit Testing rendered markup Triggering event handlers Faking authentication and authorization Emulating JavaScript interactions Testing multiple components appendix A Adding an ASP.NET Core backend to a Blazor WebAssembly app appendix B Updating existing areas to use the API
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum