@rendermode InteractiveServer

@using WorkManagementTool.Services
@inject SchoolSubjectService SchoolSubjectService

<button type="button" class="btn btn-danger" @onclick="Delete">-</button>

@code {
    [Parameter]
    public int Id { get; set; }

    [Parameter]
    public EventCallback<int> OnDeleted { get; set; }

    private async Task Delete(MouseEventArgs e)
    {
        await SchoolSubjectService.DeleteSchoolSubjectAsync(Id);
        await OnDeleted.InvokeAsync(Id);
    }
}
