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