Exemple #1
0
        public async Task Add()
        {
            await AdvocacyService.AddAsync(Current).ConfigureAwait(false);

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

            StateHasChanged();
        }
Exemple #2
0
 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);
 }
Exemple #3
0
 public async Task Delete(int id)
 {
     Collection = Collection.Where(r => r.Id != id).ToList();
     StateHasChanged();
     await AdvocacyService.DeleteAsync(id).ConfigureAwait(false);
 }
Exemple #4
0
        public async Task ShowModal(int id)
        {
            Current = await AdvocacyService.GetAsync(id).ConfigureAwait(false);

            Current.Lecturers = await LecturerService.GetAsync();
        }
Exemple #5
0
 protected override async Task OnInitAsync()
 {
     Collection = await AdvocacyService.GetAsync().ConfigureAwait(false);
 }