Skip to content

Commit 0784053

Browse files
committed
Add countries field to Home.razor; update project refs
In Home.razor, added a private field `countries` to store a collection of countries and updated `OnInitializedAsync` to initialize this field by fetching data from `CountryService`. In CountryData.Sample.ConsoleProject.csproj, removed an unnecessary project reference to simplify dependencies.
1 parent 4b74c36 commit 0784053

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

sample/CountryData.Sample.Blazor/Components/Pages/Home.razor

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ else
3636
}
3737

3838
@code {
39+
/// <summary>
40+
/// A collection of countries to be displayed on the page.
41+
/// </summary>
3942
private IEnumerable<Country>? countries;
4043

44+
/// <summary>
45+
/// Initializes the component and loads the country data.
46+
/// </summary>
4147
protected override async Task OnInitializedAsync()
4248
{
4349
countries = await CountryService.GetCountries();

sample/CountryData.Sample.Console/CountryData.Sample.ConsoleProject.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
<ItemGroup>
1111
<ProjectReference Include="..\..\src\CountryData.Standard\CountryData.Standard.csproj" />
12-
<ProjectReference Include="..\CountryData.Sample.MAUI\CountryData.Sample.MAUI\CountryData.Sample.MAUI.csproj" />
1312
</ItemGroup>
1413

1514
</Project>

0 commit comments

Comments
 (0)