@page "/calendars/{id:int}"
@inject Data.CalendarService _calendarService
Back
@if (_calendar == null || _events == null)
{
Loading...
}
else
{
Calendar "@_calendar.Name"
@foreach (var @event in _events)
{
@(@event.Summary)
@if (@event.DtStart != null)
{
Start: @(@event.DtStart)
}
@if (@event.DtEnd != null)
{
End: @(@event.DtEnd)
}
@(@event.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();
}
}