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

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

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

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