public async Task Add()
        {
            await ScienceDirectionService.AddAsync(Current).ConfigureAwait(false);

            Collection = await ScienceDirectionService.GetAsync().ConfigureAwait(false);

            StateHasChanged();
        }
 public async Task Update()
 {
     if (Collection is List <ScienceDirection> scienceDirections)
     {
         scienceDirections[scienceDirections.FindIndex(r => r.Id == Current.Id)] = Current;
     }
     else
     {
         Collection = await ScienceDirectionService.GetAsync().ConfigureAwait(false);
     }
     StateHasChanged();
     Current = await ScienceDirectionService.UpdateAsync(Current).ConfigureAwait(false);
 }
 public async Task Delete(int id)
 {
     Collection = Collection.Where(r => r.Id != id).ToList();
     StateHasChanged();
     await ScienceDirectionService.DeleteAsync(id).ConfigureAwait(false);
 }
        public async Task ShowModal(int id)
        {
            Current = await ScienceDirectionService.GetAsync(id).ConfigureAwait(false);

            Current.Lecturers = await LecturerService.GetAsync();
        }
 protected override async Task OnInitAsync()
 {
     Collection = await ScienceDirectionService.GetAsync().ConfigureAwait(false);
 }