@page "/calendars/{id:int}"
@inject Data.CalendarService _calendarService
Back
@if (_calendar == null || _events == null)
{
Loading...
}
else
{
Calendar "@_calendar.Name"
@foreach (var e in _events)
{
@e.Summary
Start: @e.DtStart
End: @e.DtEnd
@e.Description
}
}
@code
{
[Parameter]
public int Id { get; set; }
private Data.Calendar _calendar;
private List _events;
protected override async Task OnInitializedAsync()
{
_calendar = await Data.CalendarService.GetCalendarById(Id);
_events = await _calendar.GetEvents();
}
}