public async Task Add() { await FacultyService.AddAsync(Current).ConfigureAwait(false); Collection = await FacultyService.GetAsync().ConfigureAwait(false); StateHasChanged(); }
public async Task Update() { if (Collection is List <Faculty> facultyList) { facultyList[facultyList.FindIndex(r => r.Id == Current.Id)] = Current; } else { Collection = await FacultyService.GetAsync().ConfigureAwait(false); } StateHasChanged(); Current = await FacultyService.UpdateAsync(Current).ConfigureAwait(false); }
public async Task ShowModal(int id) { Current = await PulpitService.GetAsync(id).ConfigureAwait(false); Current.Faculties = await FacultyService.GetAsync(); }
public async Task ShowModal() { Current = new Pulpit { Faculties = await FacultyService.GetAsync() }; }
protected override async Task OnInitAsync() { Collection = await FacultyService.GetAsync().ConfigureAwait(false); }