public async Task Add() { await ControlService.AddAsync(Current).ConfigureAwait(false); Collection = await ControlService.GetAsync().ConfigureAwait(false); StateHasChanged(); }
public async Task ShowModal(int id) { Current = await ControlService.GetAsync(id).ConfigureAwait(false); Current.Lecturers = await LecturerService.GetAsync(); Current.Disciplines = await DisciplineService.GetAsync(); Current.Students = await StudentService.GetAsync(); }
public async Task Update() { if (Collection is List <Control> controls) { controls[controls.FindIndex(r => r.Id == Current.Id)] = Current; } else { Collection = await ControlService.GetAsync().ConfigureAwait(false); } StateHasChanged(); Current = await ControlService.UpdateAsync(Current).ConfigureAwait(false); }
protected override async Task OnInitAsync() { Collection = await ControlService.GetAsync().ConfigureAwait(false); }