Skip to content

Commit c40fa70

Browse files
authored
Merge pull request #33854 from dotnet/main
2 parents 3880783 + d4d3760 commit c40fa70

Some content is hidden

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

54 files changed

+1901
-275
lines changed

aspnetcore/blazor/advanced-scenarios.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ In <xref:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder> methods wi
3333

3434
`BuiltContent.razor`:
3535

36-
:::moniker range=">= aspnetcore-8.0"
36+
:::moniker range=">= aspnetcore-9.0"
37+
38+
:::code language="razor" source="~/../blazor-samples/9.0/BlazorSample_BlazorWebApp/Components/Pages/BuiltContent.razor":::
39+
40+
:::moniker-end
41+
42+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
3743

3844
:::code language="razor" source="~/../blazor-samples/8.0/BlazorSample_BlazorWebApp/Components/Pages/BuiltContent.razor":::
3945

aspnetcore/blazor/blazor-ef-core.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ The sample demonstrates use of EF Core to handle optimistic concurrency. However
6262

6363
The sample uses a local [SQLite](https://www.sqlite.org/index.html) database so that it can be used on any platform. The sample also configures database logging to show the SQL queries that are generated. This is configured in `appsettings.Development.json`:
6464

65-
:::moniker range=">= aspnetcore-8.0"
65+
:::moniker range=">= aspnetcore-9.0"
66+
67+
:::code language="json" source="~/../blazor-samples/9.0/BlazorWebAppEFCore/appsettings.Development.json":::
68+
69+
:::moniker-end
70+
71+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
6672

6773
:::code language="json" source="~/../blazor-samples/8.0/BlazorWebAppEFCore/appsettings.Development.json":::
6874

@@ -167,7 +173,13 @@ In the preceding factory:
167173

168174
The following example configures [SQLite](https://www.sqlite.org/index.html) and enables data logging. The code uses an extension method (`AddDbContextFactory`) to configure the database factory for DI and provide default options:
169175

170-
:::moniker range=">= aspnetcore-8.0"
176+
:::moniker range=">= aspnetcore-9.0"
177+
178+
:::code language="csharp" source="~/../blazor-samples/9.0/BlazorWebAppEFCore/Program.cs" id="snippet1":::
179+
180+
:::moniker-end
181+
182+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
171183

172184
:::code language="csharp" source="~/../blazor-samples/8.0/BlazorWebAppEFCore/Program.cs" id="snippet1":::
173185

@@ -207,7 +219,13 @@ In the home page of the sample app, `IDbContextFactory<ContactContext>` is injec
207219

208220
A `DbContext` is created using the factory (`DbFactory`) to delete a contact in the `DeleteContactAsync` method:
209221

210-
:::moniker range=">= aspnetcore-8.0"
222+
:::moniker range=">= aspnetcore-9.0"
223+
224+
:::code language="razor" source="~/../blazor-samples/9.0/BlazorWebAppEFCore/Components/Pages/Home.razor" id="snippet1":::
225+
226+
:::moniker-end
227+
228+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
211229

212230
:::code language="razor" source="~/../blazor-samples/8.0/BlazorWebAppEFCore/Components/Pages/Home.razor" id="snippet1":::
213231

@@ -274,7 +292,13 @@ You can use the factory to create a context and track it for the lifetime of the
274292

275293
The sample app ensures the context is disposed when the component is disposed:
276294

277-
:::moniker range=">= aspnetcore-8.0"
295+
:::moniker range=">= aspnetcore-9.0"
296+
297+
:::code language="csharp" source="~/../blazor-samples/9.0/BlazorWebAppEFCore/Components/Pages/EditContact.razor" id="snippet1":::
298+
299+
:::moniker-end
300+
301+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
278302

279303
:::code language="csharp" source="~/../blazor-samples/8.0/BlazorWebAppEFCore/Components/Pages/EditContact.razor" id="snippet1":::
280304

@@ -306,7 +330,13 @@ The sample app ensures the context is disposed when the component is disposed:
306330

307331
Finally, [`OnInitializedAsync`](xref:blazor/components/lifecycle) is overridden to create a new context. In the sample app, [`OnInitializedAsync`](xref:blazor/components/lifecycle) loads the contact in the same method:
308332

309-
:::moniker range=">= aspnetcore-8.0"
333+
:::moniker range=">= aspnetcore-9.0"
334+
335+
:::code language="csharp" source="~/../blazor-samples/9.0/BlazorWebAppEFCore/Components/Pages/EditContact.razor" id="snippet2":::
336+
337+
:::moniker-end
338+
339+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
310340

311341
:::code language="csharp" source="~/../blazor-samples/8.0/BlazorWebAppEFCore/Components/Pages/EditContact.razor" id="snippet2":::
312342

aspnetcore/blazor/components/built-in-components.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,45 @@ uid: blazor/components/built-in-components
1414

1515
The following built-in Razor components are provided by the Blazor framework. For information on non-security-related project template components, see <xref:blazor/project-structure>. For information on security-related project template components, see the [Security node articles](xref:blazor/security/index).
1616

17-
:::moniker range=">= aspnetcore-8.0"
17+
:::moniker range=">= aspnetcore-9.0"
18+
19+
* [`AntiforgeryToken`](xref:blazor/forms/index#antiforgery-support)
20+
* [`AuthorizeView`](xref:blazor/security/index#authorizeview-component)
21+
* [`CascadingValue`](xref:blazor/components/cascading-values-and-parameters#cascadingvalue-component)
22+
* [`DataAnnotationsValidator`](xref:blazor/forms/validation#data-annotations-validator-component-and-custom-validation)
23+
* [`DynamicComponent`](xref:blazor/components/dynamiccomponent)
24+
* [`Editor<T>`](xref:blazor/forms/binding#nest-and-bind-forms)
25+
* [`EditForm`](xref:blazor/forms/binding#editformeditcontext-model)
26+
* [`ErrorBoundary`](xref:blazor/fundamentals/handle-errors#error-boundaries)
27+
* [`FocusOnNavigate`](xref:blazor/fundamentals/routing#focus-an-element-on-navigation)
28+
* [`HeadContent`](xref:blazor/components/control-head-content)
29+
* [`HeadOutlet`](xref:blazor/components/control-head-content)
30+
* [`ImportMap`](xref:blazor/fundamentals/static-files#import-maps)
31+
* [`InputCheckbox`](xref:blazor/forms/input-components)
32+
* [`InputDate`](xref:blazor/forms/input-components)
33+
* [`InputFile`](xref:blazor/file-uploads)
34+
* [`InputNumber`](xref:blazor/forms/input-components)
35+
* [`InputRadio`](xref:blazor/forms/input-components)
36+
* [`InputRadioGroup`](xref:blazor/forms/input-components)
37+
* [`InputSelect`](xref:blazor/forms/input-components)
38+
* [`InputText`](xref:blazor/forms/input-components)
39+
* [`InputTextArea`](xref:blazor/forms/input-components)
40+
* [`LayoutView`](xref:blazor/components/layouts#apply-a-layout-to-arbitrary-content-layoutview-component)
41+
* [`NavigationLock`](xref:blazor/fundamentals/routing#handleprevent-location-changes)
42+
* [`NavLink`](xref:blazor/fundamentals/routing#navlink-component)
43+
* [`PageTitle`](xref:blazor/components/control-head-content)
44+
* [`Paginator`](xref:blazor/components/quickgrid#page-items-with-a-paginator-component)
45+
* [`QuickGrid`](xref:blazor/components/quickgrid)
46+
* [`Router`](xref:blazor/fundamentals/routing#route-templates)
47+
* [`RouteView`](xref:blazor/fundamentals/routing#route-templates)
48+
* [`SectionContent`](xref:blazor/components/sections)
49+
* [`SectionOutlet`](xref:blazor/components/sections)
50+
* [`ValidationSummary`](xref:blazor/forms/validation#validation-summary-and-validation-message-components)
51+
* [`Virtualize`](xref:blazor/components/virtualization)
52+
53+
:::moniker-end
54+
55+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
1856

1957
* [`AntiforgeryToken`](xref:blazor/forms/index#antiforgery-support)
2058
* [`AuthorizeView`](xref:blazor/security/index#authorizeview-component)

aspnetcore/blazor/components/cascading-values-and-parameters.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,22 @@ The following class is used in this section's examples.
2929

3030
`Dalek.cs`:
3131

32+
:::moniker-end
33+
34+
:::moniker range=">= aspnetcore-9.0"
35+
36+
:::code language="csharp" source="~/../blazor-samples/9.0/BlazorSample_BlazorWebApp/Dalek.cs":::
37+
38+
:::moniker-end
39+
40+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
41+
3242
:::code language="csharp" source="~/../blazor-samples/8.0/BlazorSample_BlazorWebApp/Dalek.cs":::
3343

44+
:::moniker-end
45+
46+
:::moniker range=">= aspnetcore-8.0"
47+
3448
The following registrations are made in the app's `Program` file with <xref:Microsoft.Extensions.DependencyInjection.CascadingValueServiceCollectionExtensions.AddCascadingValue%2A>:
3549

3650
* `Dalek` with a property value for `Units` is registered as a fixed cascading value.
@@ -45,8 +59,22 @@ The following `Daleks` component displays the cascaded values.
4559

4660
`Daleks.razor`:
4761

62+
:::moniker-end
63+
64+
:::moniker range=">= aspnetcore-9.0"
65+
66+
:::code language="razor" source="~/../blazor-samples/9.0/BlazorSample_BlazorWebApp/Components/Pages/Daleks.razor":::
67+
68+
:::moniker-end
69+
70+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
71+
4872
:::code language="razor" source="~/../blazor-samples/8.0/BlazorSample_BlazorWebApp/Components/Pages/Daleks.razor":::
4973

74+
:::moniker-end
75+
76+
:::moniker range=">= aspnetcore-8.0"
77+
5078
In the following example, `Dalek` is registered as a cascading value using [`CascadingValueSource<T>`](xref:Microsoft.AspNetCore.Components.CascadingValueSource%601), where `<T>` is the type. The `isFixed` flag indicates whether the value is fixed. If false, all recipients are subscribed for update notifications, which are issued by calling <xref:Microsoft.AspNetCore.Components.CascadingValueSource%601.NotifyChangedAsync%2A>. Subscriptions create overhead and reduce performance, so set `isFixed` to `true` if the value doesn't change.
5179

5280
```csharp
@@ -81,7 +109,13 @@ The following `ThemeInfo` C# class specifies the theme information.
81109
82110
`ThemeInfo.cs`:
83111

84-
:::moniker range=">= aspnetcore-8.0"
112+
:::moniker range=">= aspnetcore-9.0"
113+
114+
:::code language="csharp" source="~/../blazor-samples/9.0/BlazorSample_BlazorWebApp/ThemeInfo.cs":::
115+
116+
:::moniker-end
117+
118+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
85119

86120
:::code language="csharp" source="~/../blazor-samples/8.0/BlazorSample_BlazorWebApp/ThemeInfo.cs":::
87121

@@ -115,7 +149,13 @@ The following [layout component](xref:blazor/components/layouts) specifies theme
115149

116150
`MainLayout.razor`:
117151

118-
:::moniker range=">= aspnetcore-8.0"
152+
:::moniker range=">= aspnetcore-9.0"
153+
154+
:::code language="razor" source="~/../blazor-samples/9.0/BlazorSample_BlazorWebApp/Components/Layout/MainLayout.razor":::
155+
156+
:::moniker-end
157+
158+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
119159

120160
:::code language="razor" source="~/../blazor-samples/8.0/BlazorSample_BlazorWebApp/Components/Layout/MainLayout.razor":::
121161

@@ -196,7 +236,13 @@ The following component binds the `ThemeInfo` cascading value to a cascading par
196236

197237
`ThemedCounter.razor`:
198238

199-
:::moniker range=">= aspnetcore-8.0"
239+
:::moniker range=">= aspnetcore-9.0"
240+
241+
:::code language="razor" source="~/../blazor-samples/9.0/BlazorSample_BlazorWebApp/Components/Pages/ThemedCounter.razor":::
242+
243+
:::moniker-end
244+
245+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
200246

201247
:::code language="razor" source="~/../blazor-samples/8.0/BlazorSample_BlazorWebApp/Components/Pages/ThemedCounter.razor":::
202248

aspnetcore/blazor/components/control-head-content.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ The following example sets the page's title and description using Razor.
2424

2525
`ControlHeadContent.razor`:
2626

27-
:::moniker range=">= aspnetcore-8.0"
27+
:::moniker range=">= aspnetcore-9.0"
28+
29+
:::code language="razor" source="~/../blazor-samples/9.0/BlazorSample_BlazorWebApp/Components/Pages/ControlHeadContent.razor":::
30+
31+
:::moniker-end
32+
33+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-9.0"
2834

2935
:::code language="razor" source="~/../blazor-samples/8.0/BlazorSample_BlazorWebApp/Components/Pages/ControlHeadContent.razor":::
3036

0 commit comments

Comments
 (0)