public async Task Add() { await PulpitService.AddAsync(Current).ConfigureAwait(false); Collection = await PulpitService.GetAsync().ConfigureAwait(false); StateHasChanged(); }
public async Task Update() { if (Collection is List <Pulpit> pulpits) { pulpits[pulpits.FindIndex(r => r.Id == Current.Id)] = Current; } else { Collection = await PulpitService.GetAsync().ConfigureAwait(false); } StateHasChanged(); Current = await PulpitService.UpdateAsync(Current).ConfigureAwait(false); }
public async Task ShowModal(int id) { Current = await LecturerService.GetAsync(id).ConfigureAwait(false); Current.Pulpits = await PulpitService.GetAsync(); }
public async Task ShowModal() { Current = new Lecturer { Pulpits = await PulpitService.GetAsync() }; }
public async Task Delete(int id) { Collection = Collection.Where(r => r.Id != id).ToList(); StateHasChanged(); await PulpitService.DeleteAsync(id).ConfigureAwait(false); }
public async Task ShowModal(int id) { Current = await PulpitService.GetAsync(id).ConfigureAwait(false); Current.Faculties = await FacultyService.GetAsync(); }
protected override async Task OnInitAsync() { Collection = await PulpitService.GetAsync().ConfigureAwait(false); }