Skip to content

Commit 01e3a87

Browse files
committed
review-2
1 parent 1aff0c7 commit 01e3a87

10 files changed

+42
-42
lines changed

learn-pr/aspnetcore/blazor-build-reusable-components/3-create-razor-class-library.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Create a Razor class library
44
metadata:
55
unitType: exercise
66
title: Create a Razor class library
7-
description: "In this exercise, you'll create your first Razor class library with a component that can be used in Blazor and ASP.NET Core applications."
7+
description: "In this exercise, you create your first Razor class library with a component that can be used in Blazor and ASP.NET Core applications."
88
ms.date: 01/26/2024
99
author: csharpfritz
1010
ms.author: jefritz

learn-pr/aspnetcore/blazor-build-reusable-components/4-concept-package-razor-class-library.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Package a Razor class library
44
metadata:
55
unitType: learning-content
66
title: Package a Razor class library
7-
description: "In this unit, you'll learn how Razor class libraries are packaged when they're shared with other developers."
7+
description: "In this unit, you learn how Razor class libraries are packaged when they're shared with other developers."
88
ms.date: 01/26/2024
99
author: csharpfritz
1010
ms.author: jefritz
@@ -14,16 +14,16 @@ durationInMinutes: 3
1414
content: |
1515
[!include[](includes/4-concept-package-razor-class-library.md)]
1616
quiz:
17-
title: Check your knowledge
18-
questions:
17+
title: Check your knowledge
18+
questions:
1919
- content: "What project property is the default value for PackageId?"
2020
choices:
21-
- content: "Default namespace"
22-
isCorrect: false
23-
explanation: "Incorrect. The default namespace of the project might match the property that's used for the default PackageId, but this isn't the correct value."
24-
- content: "Project Name"
25-
isCorrect: false
26-
explanation: "Incorrect. The Project Name might match the property that's used for the default PackageId, but this isn't the correct value."
27-
- content: "AssemblyName"
28-
isCorrect: true
29-
explanation: "AssemblyName is the default value for PackageId."
21+
- content: "Default namespace"
22+
isCorrect: false
23+
explanation: "Incorrect. The default namespace of the project might match the property that's used for the default PackageId, but it isn't the correct value."
24+
- content: "Project Name"
25+
isCorrect: false
26+
explanation: "Incorrect. The Project Name might match the property that's used for the default PackageId, but it isn't the correct value."
27+
- content: "AssemblyName"
28+
isCorrect: true
29+
explanation: "AssemblyName is the default value for PackageId."

learn-pr/aspnetcore/blazor-build-reusable-components/5-nuget-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Create a NuGet package
44
metadata:
55
unitType: exercise
66
title: Create a NuGet package
7-
description: "In this exercise, you'll package the Razor class library that you created earlier."
7+
description: "In this exercise, you package the Razor class library that you created earlier."
88
ms.date: 01/26/2024
99
author: csharpfritz
1010
ms.author: jefritz

learn-pr/aspnetcore/blazor-build-reusable-components/6-summary.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ uid: learn.blazor-build-reusable-components.summary
33
title: Summary
44
metadata:
55
unitType: summary
6-
title: summary
7-
description: "This unit summarizes what you've learned about creating Razor class libraries."
6+
title: Summary
7+
description: "This unit summarizes what you learned about creating Razor class libraries."
88
ms.date: 01/26/2024
99
author: csharpfritz
1010
ms.author: jefritz

learn-pr/aspnetcore/blazor-build-reusable-components/includes/2-concepts-razor-class-library.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Components in web applications give developers the ability to reuse portions of
22

33
In this unit, you learn how to create a Razor class library. You then use it to share rendered and static content for Blazor applications to customize and display.
44

5-
## About Razor class libraries
5+
## Razor class libraries
66

7-
A Razor class library is a .NET project type that contains Razor components, pages, HTML, Cascading Style Sheet (CSS) files, JavaScript, images, and other static web content that can be referenced by a Blazor application. Like other .NET class library projects, Razor class libraries can be bundled as a NuGet package and shared on NuGet package repositories such as NuGet.org.
7+
A Razor class library is a .NET project type. It contains Razor components, pages, HTML, Cascading Style Sheet (CSS) files, JavaScript, images, and other static web content that a Blazor application can reference. Like other .NET class library projects, Razor class libraries can be bundled as a NuGet package and shared on NuGet package repositories such as NuGet.org.
88

99
Let's look at the default template for creating a Razor class library.
1010

@@ -59,7 +59,7 @@ A class library is a common package delivery structure in .NET applications, and
5959

6060
### Razor component contents
6161

62-
The initial Razor component that's delivered is simple. It contains only an HTML `div` element with a short block of text:
62+
This initial Razor component is simple. It contains only an HTML `div` element with a short block of text:
6363

6464
```razor
6565
<div class="my-component">
@@ -71,7 +71,7 @@ This component interacts with other Blazor components and pages that reference i
7171

7272
### Static asset delivery
7373

74-
You can reference the contents of the *wwwroot* folder relatively among the other contents of that folder and the components' individual CSS files, such as *Component1.razor.css*, as files in the same base folder. For example, the default CSS adds a two pixel dashed red border and a background image style that uses the *background.png* image in the *wwwroot* folder. No path is required to make this reference from the CSS to the content that resides in the *wwwroot* folder.
74+
You can reference the contents of the *wwwroot* folder relatively among the other contents of that folder. You can also relatively reference the components' individual CSS files, such as *Component1.razor.css*, as files in the same base folder. For example, the default CSS adds a two pixel dashed red border and a background image style that uses the *background.png* image in the *wwwroot* folder. No path is required to make this reference from the CSS to the content that resides in the *wwwroot* folder.
7575

7676
```css
7777
.my-component {
@@ -82,7 +82,7 @@ You can reference the contents of the *wwwroot* folder relatively among the othe
8282
}
8383
```
8484

85-
The contents of the *wwwroot* folder are available to be referenced by hosted Blazor applications with an absolute folder reference in the format:
85+
The contents of the *wwwroot* folder are available for referencing by hosted Blazor applications with an absolute folder reference in the format:
8686

8787
```dotnetcli
8888
/_content/{PACKAGE_ID}/{PATH_AND_FILENAME_INSIDE_WWWROOT}

learn-pr/aspnetcore/blazor-build-reusable-components/includes/3-create-razor-class-library.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In this exercise, you'll create a modal dialog in a Razor class library that you can reuse in the default Blazor template application.
1+
In this exercise, you create a modal dialog in a Razor class library that you can reuse in the default Blazor template application.
22

33
![Screenshot of the modal dialog to be created in the standard Blazor template application.](../media/first-modal.png)
44

@@ -162,7 +162,7 @@ With the modal component now residing in the *FirstClassLibrary* project, add a
162162
dotnet new blazor -o MyBlazorApp -f net8.0
163163
```
164164
165-
1. In the *MyBlazorApp* project, add a reference to the *FirstClassLibrary* project either by using the Visual Studio Add Reference feature or by running the following command from the *MyBlazorApp* folder:
165+
1. Add a reference to the *FirstClassLibrary* project in the *MyBlazorApp* project, either by using the Visual Studio Add Reference feature or by running the following command from the *MyBlazorApp* folder:
166166
167167
```dotnetcli
168168
dotnet add reference ../FirstClassLibrary

learn-pr/aspnetcore/blazor-build-reusable-components/includes/4-concept-package-razor-class-library.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
A task you'll often perform is packaging libraries for reuse by other developers. NuGet packaging makes it trivial for any developer anywhere to acquire and properly configure all the .NET references for their applications.
1+
A task that you often need to perform is packaging libraries for reuse by other developers. NuGet packaging makes it trivial for any developer anywhere to acquire and properly configure all the .NET references for their applications.
22

3-
In the preceding unit, you built your modal dialog component and used it in your own application. Now you'll want to reuse it in other applications.
3+
In the preceding unit, you built your modal dialog component and used it in your own application. Now you want to reuse it in other applications.
44

5-
In this unit, you'll learn the steps necessary to configure a Razor class library as a NuGet package. You'll also learn how to package the library for distribution by using a package-repository service, such as NuGet.org, or GitHub repositories.
5+
In this unit, you learn the steps necessary to configure a Razor class library as a NuGet package. You also learn how to package the library for distribution by using a package-repository service, such as NuGet.org, or GitHub repositories.
66

77
## Configure a Razor class library for NuGet packaging
88

9-
The .NET ecosystem makes it easy to define the properties that are necessary for other developers to identify and use your components. You can define all these properties in the project file (*\*.csproj*) of your Razor class library so that they travel with the library and are updated appropriately when your library is updated.
9+
The .NET ecosystem makes it easy to define the properties that are necessary for other developers to identify and use your components. You can define all these properties in the project file (*\*.csproj*) of your Razor class library so they travel with the library. The properties are then updated appropriately when your library is updated.
1010

1111
You can configure fields that identify your package in the **Visual Studio Project Properties - Package** dialog, or you can create entries directly in the *\*.csproj* file yourself.
1212

@@ -23,7 +23,7 @@ Some of these fields have default values, and it might look funny to publish a p
2323

2424
In the preceding unit, you learned that the static content of a Razor class library is available at `_content/[PACKAGE_ID]/`, and now you see where the `PackageId` value is configured.
2525

26-
A sample project file with these values configured might look like the following:
26+
A sample project file with these values configured might look like the following example:
2727

2828
```xml
2929
<PropertyGroup>
@@ -34,7 +34,7 @@ A sample project file with these values configured might look like the following
3434
</PropertyGroup>
3535
```
3636

37-
When you're building the project, you can also configure it to generate a NuGet package either by selecting the **Generate NuGet Package on Build** option in the Visual Studio **Project Properties** dialog or by adding a `GeneratePackageOnBuild` entry next to the other package fields, as shown here:
37+
When you're building the project, you can also configure it to generate a NuGet package either by selecting the option to **Generate NuGet Package on Build** in the Visual Studio **Project Properties** dialog or by adding a `GeneratePackageOnBuild` entry next to the other package fields, as shown here:
3838

3939
```xml
4040
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
@@ -52,7 +52,7 @@ For a full list of properties, check the Microsoft documentation on the [MSBuild
5252

5353
## Package the library
5454

55-
After you've written the library configuration into the *\*.csproj* file, you can generate the NuGet package either in Visual Studio, by right-clicking the project and selecting the **Pack** command, or in the project folder, by running the following command:
55+
After you write the library configuration into the *\*.csproj* file, you can generate the NuGet package either in Visual Studio, by right-clicking the project and selecting the **Pack** command, or in the project folder, by running the following command:
5656

5757
```dotnetcli
5858
dotnet pack

learn-pr/aspnetcore/blazor-build-reusable-components/includes/5-nuget-package.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
When you package your Razor class library, you have a binary deliverable that can be referenced by Blazor projects, and the components within it can be used in those projects.
1+
When you package your Razor class library, you have a binary deliverable that other Blazor projects can reference and the components within it can be used in those projects.
22

33
In an earlier unit, you created a Razor class library with a modal component that delivers a modal dialog window for Blazor applications. To share that component for use in other applications, you need to package and place it in either a repository or a folder where other developers can acquire it.
44

5-
In this unit, you'll update that project and generate a NuGet package. Finally, you'll deploy that NuGet package to your Blazor server application.
5+
In this unit, you update that project and generate a NuGet package. Finally, you deploy that NuGet package to your Blazor server application.
66

77
## Add package properties to FirstClassLibrary
88

9-
Begin by updating the *FirstClassLibrary* project with properties that will allow it to be packaged for deployment as a NuGet package.
9+
Begin by updating the *FirstClassLibrary* project with properties that allow it to be packaged for deployment as a NuGet package.
1010

11-
1. Open the project file for the *MyClassLibrary* project either by double-clicking the project in Visual Studio Solution Explorer or by opening the *MyClassLibrary.csproj* file in Visual Studio Code.
11+
1. Open the project file for the *MyClassLibrary* project. Either double-click the project in Visual Studio Solution Explorer or open the *MyClassLibrary.csproj* file in Visual Studio Code.
1212
1. Near the top of the file, in the section with the `<PropertyGroup>` tag, add the following content before the closing `</PropertyGroup>` tag:
1313

1414
```xml
@@ -40,9 +40,9 @@ This command writes a file named *My.FirstClassLibrary.0.1.0.nupkg* to your *bin
4040

4141
You already referenced the *FirstClassLibrary* project in your MyBlazorServer application, because it was in the same folder structure as the web application.
4242

43-
Now, you'll undo that project reference and add a reference to the NuGet package that you created earlier.
43+
Now, you undo that project reference and add a reference to the NuGet package that you created earlier.
4444

45-
These steps are *not* a typical configuration. Library projects that reside in the same folders or solution as the applications that want to reference them can reference the project directly, as you saw in the earlier exercise.
45+
The following steps *don't* describe a typical configuration. Library projects that reside in the same folders or solution as the applications that want to reference them can reference the project directly, as you saw in the earlier exercise.
4646

4747
1. Open the *MyBlazorServer.csproj* file either by double-clicking the *MyBlazorServer* project name in Visual Studio or by opening the file in Visual Studio Code.
4848
1. In the *MyBlazorServer.csproj* file, remove the following line:
@@ -59,7 +59,7 @@ These steps are *not* a typical configuration. Library projects that reside in t
5959
6060
## Check your work
6161
62-
Did your new package install properly? Can you start the FirstServer application and see a modal window when the application starts?
62+
Did your new package install properly? Can you start the FirstServer application and see a modal window when the application starts?
6363
6464
Let's find out:
6565
@@ -69,4 +69,4 @@ Let's find out:
6969
7070
1. In your browser, go to the home page of the MyBlazorServer application: ``` https://localhost:5000 ```.
7171
72-
Is the **My first Modal dialog** dialog displayed? If so, congratulations! You've successfully packaged and deployed the *FirstClassLibrary* project correctly. Applications everywhere can now use your modal window component by referencing your newly created NuGet package.
72+
Is the **My first Modal dialog** dialog displayed? If so, congratulations! You successfully packaged and deployed the *FirstClassLibrary* project correctly. Applications everywhere can now use your modal window component by referencing your newly created NuGet package.

learn-pr/aspnetcore/blazor-build-reusable-components/includes/6-summary.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
In this module, you faced and resolved a problem with building, packaging, and sharing Blazor components that can be used and reused across Blazor applications.
1+
In this module, you faced and resolved a problem with building, packaging, and sharing Blazor components for use and reuse across Blazor applications.
22

33
You learned how to build a Razor class library that contains components to be shared with many applications. To assemble the library, you:
44

55
- Created a new Razor class library from the .NET template.
6-
- Added a *.razor* file with a Blazor component and a *.razor.css* file that contains its style sheet.
6+
- Added a `.razor` file with a Blazor component and a `.razor.css` file that contains its style sheet.
77
- Added package metadata to the project file, which defines the package for other developers.
88
- Created a NuGet package from your Razor class library by using the .NET command-line interface.
99

10-
Blazor components are the building blocks that make it easier for you to build more complex applications. By building components and pages that reference other components, you can more quickly deliver applications that take advantage of the user-interface paradigms that other developers have shared with you. When you can depend on reusing earlier investments made by other developers, you can save time and money on your own projects as well.
10+
Blazor components are the building blocks that make it easier for you to build more complex applications. By building components and pages that reference other components, you can more quickly deliver applications that take advantage of the user-interface paradigms that other developers share with you. When you can depend on reusing earlier investments made by other developers, you can save time and money on your own projects as well.
1111

1212
## References
1313

learn-pr/aspnetcore/blazor-build-reusable-components/index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ metadata:
1414
title: Build reusable components with Blazor
1515
summary: "By using Blazor components, you can reuse sections of HTML in your applications. Learn how to build a component, package it, and share it with other Blazor applications."
1616
abstract: |
17-
By the end of this module, you'll be able to:
17+
By the end of this module, you're able to:
1818
- Build a Razor class library that contains Blazor components.
1919
- Package a Razor class library for use in other Blazor applications.
2020
- Reference a Razor class library in a Blazor application and use its components.

0 commit comments

Comments
 (0)