예제 #1
0
        public async Task Add()
        {
            await FacultyService.AddAsync(Current).ConfigureAwait(false);

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

            StateHasChanged();
        }
예제 #2
0
 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);
 }
예제 #3
0
        public async Task ShowModal(int id)
        {
            Current = await PulpitService.GetAsync(id).ConfigureAwait(false);

            Current.Faculties = await FacultyService.GetAsync();
        }
예제 #4
0
 public async Task ShowModal()
 {
     Current = new Pulpit {
         Faculties = await FacultyService.GetAsync()
     };
 }
예제 #5
0
 protected override async Task OnInitAsync()
 {
     Collection = await FacultyService.GetAsync().ConfigureAwait(false);
 }