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

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

            StateHasChanged();
        }
Exemplo 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);
 }
Exemplo n.º 3
0
        public async Task ShowModal(int id)
        {
            Current = await AdvocacyService.GetAsync(id).ConfigureAwait(false);

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