adding some views

This commit is contained in:
2026-03-22 16:28:01 +01:00
parent 498d46c10f
commit 7594d179a8
16 changed files with 327 additions and 92 deletions
+31
View File
@@ -0,0 +1,31 @@
using CityInfo.WEB.Models;
using CityInfo.WEB.Services;
using Microsoft.AspNetCore.Components;
namespace CityInfo.WEB.Pages
{
public partial class CityDetails
{
[Inject]
public ICityDataService CityDataService { get; set; } = default!;
[Inject]
public IPointOfInterestDataService PointOfInterestDataService { get; set; }
[Inject]
public NavigationManager NavigationManager { get; set; } = default!;
[Parameter]
public int CityId { get; set; }
public City? City { get; set; }
public IEnumerable<PointOfInterest> PointsOfInterest { get; set; } = new List<PointOfInterest>();
protected async override Task OnInitializedAsync()
{
City = await CityDataService.GetCity(CityId);
if(City == null)
{
NavigationManager.NavigateTo("/not-found");
}
PointsOfInterest = await PointOfInterestDataService.GetPointsOfInterest(CityId);
}
}
}