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