Skip to content

Commit c7b835d

Browse files
authored
Add new Blazor tutorial on BWA with EF Core (#32747)
1 parent ce61676 commit c7b835d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2965
-3
lines changed

aspnetcore/blazor/call-web-api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,12 @@ Various network tools are publicly available for testing web API backend apps di
901901
* [Cross-Origin Resource Sharing (CORS) at W3C](https://www.w3.org/TR/cors/)
902902
* <xref:security/cors>: Although the content applies to ASP.NET Core apps, not Razor components, the article covers general CORS concepts.
903903

904+
### Mitigation of overposting attacks
905+
906+
Web APIs can be vulnerable to an *overposting* attack, also known as a *mass assignment* attack. An overposting attack occurs when a malicious user issues an HTML form POST to the server that processes data for properties that aren't part of the rendered form and that the developer doesn't wish to allow users to modify. The term "overposting" literally means that the malicious user has *over*-POSTed with the form.
907+
908+
For guidance on mitigating overposting attacks, see <xref:tutorials/first-web-api#prevent-over-posting>.
909+
904910
### Server-side
905911

906912
* <xref:blazor/security/server/additional-scenarios>: Includes coverage on using <xref:System.Net.Http.HttpClient> to make secure web API requests.

aspnetcore/blazor/components/data-binding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ Specifying a format for the `date` field type isn't recommended because Blazor h
553553

554554
A common scenario is binding a property of a child component to a property in its parent component. This scenario is called a *chained bind* because multiple levels of binding occur simultaneously.
555555

556-
You can't implement chained binds with [`@bind`](xref:mvc/views/razor#bind) syntax in a child component. An event handler and value must be specified separately to support updating the property in the parent from the child component. The parent component still leverages [`@bind`](xref:mvc/views/razor#bind) syntax to set up databinding with the child component.
556+
You can't implement chained binds with [`@bind`](xref:mvc/views/razor#bind) syntax in a child component. An event handler and value must be specified separately to support updating the property in the parent from the child component. The parent component still leverages [`@bind`](xref:mvc/views/razor#bind) syntax to set up data binding with the child component.
557557

558558
The following `ChildBind` component has a `Year` component parameter and an <xref:Microsoft.AspNetCore.Components.EventCallback%601>. By convention, the <xref:Microsoft.AspNetCore.Components.EventCallback%601> for the parameter must be named as the component parameter name with a "`Changed`" suffix. The naming syntax is `{PARAMETER NAME}Changed`, where the `{PARAMETER NAME}` placeholder is the parameter name. In the following example, the <xref:Microsoft.AspNetCore.Components.EventCallback%601> is named `YearChanged`.
559559

aspnetcore/blazor/components/quickgrid.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ When you paste multiple commands, all of the commands execute except the last on
386386
```dotnetcli
387387
dotnet tool install --global dotnet-aspnet-codegenerator
388388
dotnet tool install --global dotnet-ef
389-
dotnet add package Microsoft.EntityFrameworkCore.Design
390389
dotnet add package Microsoft.EntityFrameworkCore.SQLite
391390
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
392391
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
@@ -439,7 +438,6 @@ When you paste multiple commands, all of the commands execute except the last on
439438
```dotnetcli
440439
dotnet tool install --global dotnet-aspnet-codegenerator
441440
dotnet tool install --global dotnet-ef
442-
dotnet add package Microsoft.EntityFrameworkCore.Design
443441
dotnet add package Microsoft.EntityFrameworkCore.SQLite
444442
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
445443
dotnet add package Microsoft.EntityFrameworkCore.SqlServer

aspnetcore/blazor/tutorials/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ For an overview of Blazor, see <xref:blazor/index>.
2222

2323
* <xref:blazor/tutorials/build-a-blazor-app> (Blazor Web App)
2424

25+
* <xref:blazor/tutorials/movie-database-app/index> (Blazor Web App)
26+
2527
* <xref:blazor/tutorials/signalr-blazor> (Blazor Web App)
2628

2729
* <xref:blazor/hybrid/tutorials/index>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
If you run into a problem while following the tutorial that you can't resolve from the text, compare your code to the completed project in the Blazor samples repository:
2+
3+
[Blazor samples GitHub repository (`dotnet/blazor-samples`)](https://github.com/dotnet/blazor-samples)
4+
5+
Select the latest version folder. The sample folder for this tutorial's project is named `BlazorWebAppMovies`.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Build a Blazor movie database app (Overview)
3+
author: guardrex
4+
description: This tutorial explains the basics of building a Blazor Web App with a database, Entity Framework (EF) Core, and user interactivity.
5+
ms.author: riande
6+
ms.date: 08/26/2024
7+
monikerRange: '>= aspnetcore-8.0'
8+
ms.custom: mvc
9+
uid: blazor/tutorials/movie-database-app/index
10+
---
11+
# Build a Blazor movie database app (Overview)
12+
13+
<!-- UPDATE 9.0 Activate after release
14+
15+
[!INCLUDE[](~/includes/not-latest-version.md)]
16+
17+
-->
18+
19+
This tutorial explains the basics of building a Blazor Web App with a database, Entity Framework (EF) Core, and user interactivity.
20+
21+
Parts of this series include:
22+
23+
1. [Create a Blazor Web App](xref:blazor/tutorials/movie-database-app/part-1)
24+
1. [Add and scaffold a model](xref:blazor/tutorials/movie-database-app/part-2)
25+
1. [Learn about Razor components](xref:blazor/tutorials/movie-database-app/part-3)
26+
1. [Work with a database](xref:blazor/tutorials/movie-database-app/part-4)
27+
1. [Add validation](xref:blazor/tutorials/movie-database-app/part-5)
28+
1. [Add search](xref:blazor/tutorials/movie-database-app/part-6)
29+
1. [Add a new field](xref:blazor/tutorials/movie-database-app/part-7)
30+
1. [Add interactivity](xref:blazor/tutorials/movie-database-app/part-8)
31+
32+
At the end of the tutorial, you'll have a Blazor Web App that can display and manage movies in a movie database.
33+
34+
## Sample app
35+
36+
If you don't intend to create the demonstration app while reading the article, you can refer to the completed sample app in the [Blazor samples GitHub repository (`dotnet/blazor-samples`)](https://github.com/dotnet/blazor-samples). Select the latest version folder in the repository. The sample folder for this tutorial's project is named `BlazorWebAppMovies`.
37+
38+
## Article code examples
39+
40+
The line breaks of code examples shown in the ASP.NET Core documentation often don't match line breaks in scaffolded code generated by tooling for an app. This is due to an article publishing limitation. Lines of code in articles are generally limited to 85 characters in length, and we manually adjust the line length using line breaks to satisfy our publishing guidelines.
41+
42+
As you work through this tutorial or use any other ASP.NET Core article's code examples, you never need to adjust scaffolded code in your app to match the line breaks displayed in article code examples.
43+
44+
## Report a tutorial issue
45+
46+
To open a documentation GitHub issue for an article of the series, use the **Open a documentation issue** link at the bottom of the article. Using the link to create your issue adds important tracking metadata to the issue and automatically pings the author of the article.
47+
48+
## Support requests
49+
50+
We welcome feedback on the tutorial's articles, such as bug reports and comments on the article's text, but we're often unable to provide product support. If you run into a problem while following the tutorial, don't immediately open a documentation issue. Check the steps that you've taken against the article and compare your code to the [sample app](#sample-app) before opening an issue because many problems can be traced to missing a step or not following a step correctly.
51+
52+
For general questions about .NET and Blazor beyond the tutorial and reference documentation or to obtain assistance from the .NET community, converse with developers in [public forums](xref:blazor/fundamentals/index#support-requests).
53+
54+
## Next steps
55+
56+
> [!div class="step-by-step"]
57+
> [Next: Create a Blazor Web App](xref:blazor/tutorials/movie-database-app/part-1)

0 commit comments

Comments
 (0)